SHARE
TWEET

Untitled

a guest Jul 22nd, 2014 238 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Demo program using the Dagu Arduino Mini Driver - simple strobe.    
  2.  
  3. const int PANEL1 = 2;
  4. const int PANEL2 = 3;
  5. const int PANEL3 = 4;
  6. const int PANEL4 = 5;
  7. const int PANEL5 = 6;
  8. const int PANEL6 = 7;
  9.  
  10. const int LED_PIN = 13; // Useful for debugging / checking behaviour is working
  11.  
  12. const int delaytime = 500;
  13.  
  14. //----------------------------------------------------------
  15. void setup()
  16. {
  17.     // Setup the pins
  18.     pinMode( PANEL1, OUTPUT );
  19.     pinMode( PANEL2, OUTPUT );
  20.     pinMode( PANEL3, OUTPUT );
  21.     pinMode( PANEL4, OUTPUT );
  22.     pinMode( PANEL5, OUTPUT );
  23.     pinMode( PANEL6, OUTPUT );
  24.  
  25.     pinMode( LED_PIN, OUTPUT );
  26. }
  27.  
  28. void iterate() {
  29.  
  30.     digitalWrite( LED_PIN, HIGH );
  31.     digitalWrite( PANEL1, HIGH );
  32.     delay( delaytime );
  33.     digitalWrite( LED_PIN, LOW );
  34.     digitalWrite( PANEL1, LOW );
  35.     delay( delaytime );
  36.  
  37.     digitalWrite( LED_PIN, HIGH );
  38.     digitalWrite( PANEL2, HIGH );
  39.     delay( delaytime );
  40.     digitalWrite( LED_PIN, LOW );
  41.     digitalWrite( PANEL2, LOW );
  42.     delay( delaytime );
  43.  
  44.     digitalWrite( LED_PIN, HIGH );
  45.     digitalWrite( PANEL3, HIGH );
  46.     delay( delaytime );
  47.     digitalWrite( LED_PIN, LOW );
  48.     digitalWrite( PANEL3, LOW );
  49.     delay( delaytime );
  50.  
  51.     digitalWrite( LED_PIN, HIGH );
  52.     digitalWrite( PANEL4, HIGH );
  53.     delay( delaytime );
  54.     digitalWrite( LED_PIN, LOW );
  55.     digitalWrite( PANEL4, LOW );
  56.     delay( delaytime );
  57.  
  58.     digitalWrite( LED_PIN, HIGH );
  59.     digitalWrite( PANEL5, HIGH );
  60.     delay( delaytime );
  61.     digitalWrite( LED_PIN, LOW );
  62.     digitalWrite( PANEL5, LOW );
  63.     delay( delaytime );
  64.  
  65.  
  66.     digitalWrite( LED_PIN, HIGH );
  67.     digitalWrite( PANEL6, HIGH );
  68.     delay( delaytime );
  69.     digitalWrite( LED_PIN, LOW );
  70.     digitalWrite( PANEL6, LOW );
  71.     delay( delaytime );
  72.  
  73. }
  74.  
  75. //----------------------------------------------------------
  76. void loop()
  77. {
  78.     iterate();
  79. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top