Permalink
Browse files

Remerged in proper Dacwes handling.

Changed addressing mode to ADDRESSING_HORIZONTAL_NORMAL.
  • Loading branch information...
potatono committed May 19, 2012
1 parent 7ea74da commit 3063cae2f07f1d87878f4d4171a2af9f99501ade
Showing with 36 additions and 4 deletions.
  1. +4 −2 CrawlTest.pde
  2. +31 −1 Dacwes.pde
  3. +1 −1 domeTransmitter.pde
View
@@ -9,8 +9,10 @@ class CrawlTest extends Routine {
void draw() {
background(0);
-
- x++;
+
+ if (frameCount % 4 == 0) {
+ x++;
+ }
if (x>width) {
x=0;
y++;
View
@@ -81,10 +81,40 @@ public class Dacwes {
private int getAddress(int x, int y) {
if (addressingMode == ADDRESSING_VERTICAL_NORMAL) {
+ return (x * h + y);
+ }
+ else if (addressingMode == ADDRESSING_VERTICAL_HALF) {
+ return ((y % pixelsPerChannel) + floor(y / pixelsPerChannel)*pixelsPerChannel*w + x*pixelsPerChannel);
+ }
+ else if (addressingMode == ADDRESSING_VERTICAL_FLIPFLOP) {
+ if (y>=pixelsPerChannel) {
+ int endAddress = (x+1) * h - 1;
+ int address = endAddress - (y % pixelsPerChannel);
+ return address;
+ }
+ else {
+ return (x * h + y);
+ }
+ }
+ else if (addressingMode == ADDRESSING_HORIZONTAL_NORMAL) {
return (y * w + x);
}
+ else if (addressingMode == ADDRESSING_HORIZONTAL_HALF) {
+ return ((x % pixelsPerChannel) + floor(x / pixelsPerChannel)*pixelsPerChannel*h + y*pixelsPerChannel);
+ }
+ else if (addressingMode == ADDRESSING_HORIZONTAL_FLIPFLOP) {
+ if (x>=pixelsPerChannel) {
+ int endAddress = (y+1) * w - 1;
+ int address = endAddress - (x % pixelsPerChannel);
+ return address;
+ }
+ else {
+ return (y * h + x);
+ }
+ }
+
return 0;
- }
+ }
public void sendMode(String modeName) {
byte modeBuffer[] = new byte[modeName.length()+1];
View
@@ -57,7 +57,7 @@ void setup() {
dacwes = new Dacwes(this, WIDTH, HEIGHT);
dacwes.setAddress(hostname);
- dacwes.setAddressingMode(Dacwes.ADDRESSING_VERTICAL_NORMAL);
+ dacwes.setAddressingMode(Dacwes.ADDRESSING_HORIZONTAL_NORMAL);
setMode(0);

0 comments on commit 3063cae

Please sign in to comment.