Guest User

Untitled

a guest
Jan 16th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. "use strict";
  2.  
  3. t = Date.call('now').match(/\w* \w* \w* \d* (\d+):(\d+)/);
  4.  
  5. //Commend this line out
  6.  
  7. //to save you project. un commend when you want to work with it again.
  8.  
  9. var hours = parseInt(t[1], 10); //Hours
  10.  
  11. if(hours>12){hours=hours-12;} //if above 12 hours, subtract 12
  12.  
  13. var minutes = parseInt(t[2], 10); //Minutes
  14.  
  15. var FIVEminutes = minutes / 5;
  16.  
  17. if(Switch0 != 1)
  18.  
  19. {
  20.  
  21. for(var e = 0; e < hours; e++)
  22.  
  23. {
  24.  
  25. CM.sendTo("RGBLED0", [100,0,0], 500+(1000*e));
  26.  
  27. CM.sendTo("RGBLED0",[0,0,0], 1000+(1000*e));
  28.  
  29. }
  30.  
  31. for(var i = 0; i < FIVEminutes; i++)
  32.  
  33. {
  34.  
  35. CM.sendTo("RGBLED0", [0,0,100], 500+(1000*i)+(1000*hours));
  36.  
  37. CM.sendTo("RGBLED0",[0,0,0], 1000+(1000*i)+(1000*hours));
  38.  
  39. }
  40.  
  41. }
Add Comment
Please, Sign In to add comment