From Colorant Crocodile, 3 Weeks ago, written in C++.
This paste will self destruct in 5 Days.
Embed
  1. //VARIABLES
  2. int dlyON = 35; //delay for strobes on in millseconds
  3. int dlyOFF = 50; //delay for strobes off in millseconds
  4. int flshNO = 4; // Number of flashes for each strobe before swapping sides
  5. int dlyHL = 250; // Time in milliseconds to leave incandescent on
  6.  
  7. //SETUP
  8. void setup()
  9. {
  10.   pinMode(13, OUTPUT); //RH LED Strobe SSR A
  11.   pinMode(12, OUTPUT); //LH LED Strobe SSR B
  12.   pinMode(11, OUTPUT); //NO-LH Headlight & RH Reverse/NC-LH Indicator Relay A
  13.   pinMode(10, OUTPUT); //NO-RH Headlight & RH Reverse/NC-RH Indicator Relay B
  14.   pinMode(9, OUTPUT); // NO-In Car LED Strobes 6 x 3 Relay C
  15.  
  16.   pinMode(2, OUTPUT); //Main Power Relay D
  17.   pinMode(3, OUTPUT); //Cabin Indicator LED
  18.  
  19.   digitalWrite(9, HIGH); //Turn On Cabin Strobes
  20.   digitalWrite(3, HIGH); //Turn On Main Power
  21.   digitalWrite(2, HIGH); //Turn On Cabin Indicator
  22.  
  23. }
  24.  
  25.  
  26. void loop()
  27. {
  28.  
  29.   lightsA();
  30.  
  31.   strobeLeft();
  32.   strobeRight();
  33.  
  34.   lightsB();
  35.  
  36.   strobeLeft();
  37.   strobeRight();
  38.  
  39.   lightsA();
  40.  
  41.   strobeRight();
  42.   strobeLeft();
  43.  
  44.   lightsB();
  45.  
  46.   strobeRight();
  47.   strobeLeft();
  48.  
  49.   lightsA();
  50.  
  51.   strobeLeft();
  52.   strobeRight();
  53.  
  54.   lightsB();
  55.  
  56.   strobeRight();
  57.   strobeLeft();
  58.  
  59.   lightsA();
  60.  
  61.   strobeLeft();
  62.   strobeRight();
  63.  
  64.   lightsB();
  65.   lightsC();
  66.   delay(dlyHL);
  67.   lightsD();
  68.   delay(dlyHL);
  69.   lightsC();
  70.   delay(dlyHL);
  71.   lightsD();
  72.   delay(dlyHL);
  73.   lightsC();
  74.   delay(dlyHL);
  75.   lightsD();
  76.   delay(dlyHL);
  77.   lightsC();
  78.   delay(dlyHL);
  79.   lightsD();
  80.   delay(dlyHL);
  81. }
  82.  
  83. void strobeLeft()
  84. {
  85.   for (int cnt=0; cnt <= flshNO; cnt++){
  86.     digitalWrite(12, HIGH);
  87.     delay(dlyON);
  88.     digitalWrite(12, LOW);
  89.     delay(dlyOFF);
  90.   }
  91. }
  92.  
  93. void strobeRight()
  94. {
  95.   for (int cnt=0; cnt <= flshNO; cnt++){
  96.     digitalWrite(13, HIGH);
  97.     delay(dlyON);
  98.     digitalWrite(13, LOW);
  99.     delay(dlyOFF);
  100.   }
  101. }
  102.  
  103. void lightsA()
  104. {
  105.   digitalWrite(11, HIGH);
  106.   digitalWrite(10, LOW);
  107.   digitalWrite(2, HIGH);
  108. }
  109.  
  110. void lightsB()
  111. {
  112.   digitalWrite(11, LOW);
  113.   digitalWrite(10, HIGH);
  114.   digitalWrite(2, LOW);
  115. }
  116. void lightsC()
  117. {
  118.   digitalWrite(11, HIGH);
  119.   digitalWrite(10, LOW);
  120.   digitalWrite(12, HIGH);
  121.   digitalWrite(13, LOW);
  122.   digitalWrite(2, HIGH);
  123. }
  124.  
  125. void lightsD()
  126. {
  127.   digitalWrite(11, LOW);
  128.   digitalWrite(10, HIGH);
  129.   digitalWrite(12, LOW);
  130.   digitalWrite(13, HIGH);
  131.   digitalWrite(2, LOW);
  132. }
  133.  
  134. //EOF