Advertisement
Guest User

Raidovan

a guest
Dec 8th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. x = 4;
  2. y = 4;
  3. accx = 1;
  4. accy = 1;
  5. w = 7;
  6. h = 7;
  7.  
  8. pad[8]=[0,0,1,1,1,1,0,0]
  9. void setup() {
  10.   // put your setup code here, to run once:
  11.  
  12. }
  13.  
  14. void loop() {
  15.   // put your main code here, to run repeatedly:
  16.   if (x<=0 or x>=w){
  17.     accx=-accx;
  18.   }
  19.    if (y<=0 or y>=h){
  20.     accy=-accy;
  21.   }
  22.   x += accx;
  23.   y +=accy;
  24.  
  25.   lc.setLed(0, x, y, 1);
  26.   delay(200);
  27.   lc.clearDisplay(0);
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement