Commits

Joseph Chiocchi  committed 8cb340f

refactor attempt

  • Participants
  • Parent commits db0ee01
  • Branches newpixels

Comments (0)

Files changed (2)

File yrainbow_firmware/yrainbow_firmware.ino

   }
 }  
 
+
 void drawLine(int sx, int sy, int ex, int ey, byte r, byte g, byte b) {
   int i, lx, ly;
   
   }
 }
 
+
+
+
 void drawSquare(int sx, int sy, int ex, int ey, byte r, byte g, byte b) {
   int i, ly, rw;
   
   b = b | (b<<4);
   
   for (y=0; y<8; y++){
-    for(x=0; x<8; x++){
+    for(x=0; x<4; x++){
       dots_color[bufBack][G][y][x]=g;
       dots_color[bufBack][R][y][x]=r;
       dots_color[bufBack][B][y][x]=b;
+      dots_Color[bufFront][G][y]x
     }
 
   }

File yrainbow_master/yrainbow_master.ino

 //  sendCMD(0x10, CMD_CLEAR_BUF, toByte(random('1', '9'+1)), toByte(random('1', '9'+1)), toByte(random('1', '9'+1)));
 //  delay(20);
 //  sendCMD(0x10, CMD_SWAP_BUF);
-//
-//
+
+
 
 
 
   buttonState = digitalRead(buttonPin);
 
 
-  if (buttonState != HIGH){
- 
-
-     
-     sendCMD(0x10, CMD_CLEAR_PAPER);
-     sendCMD(0x10, CMD_COPY_FRONT_BUF, toByte(0), toByte(8));
-
-//     sendCMD(0x10, CMD_DRAW_SQUARE, toByte(0), toByte(0), toByte(8), toByte(8));
-    sendCMD(0x10, CMD_CLEAR_BUF, r, g, b);
-          sendCMD(0x10, CMD_SWAP_BUF);
-
-     delay(50);
-
-   } else{
-
-     r = random(0xF);
-     g = random(0xF);
-     b = random(0xF);
-     sendCMD(0x10, CMD_SET_INK, r, g, b);
-
-   }
+//  if (buttonState != HIGH){
+//
+//
+//     
+//     sendCMD(0x10, CMD_CLEAR_PAPER);
+//     sendCMD(0x10, CMD_COPY_FRONT_BUF, toByte(0), toByte(8));
+//
+////     sendCMD(0x10, CMD_DRAW_SQUARE, toByte(0), toByte(0), toByte(8), toByte(8));
+//    sendCMD(0x10, CMD_CLEAR_BUF, r, g, b);
+//          sendCMD(0x10, CMD_SWAP_BUF);
+//
+//     delay(50);
+//
+//   } else{
+//
+//     r = random(0xF);
+//     g = random(0xF);
+//     b = random(0xF);
+//     sendCMD(0x10, CMD_SET_INK, r, g, b);
+//
+//   }
   delay(1);
 }