Flashing Light Prize (1) Arduino Wave Generator
Probable electrocution? Check.
Deadly noxious fumes? Inhaled.
KY Jelly? Lubricated.
Let's show this prehistoric bitch how we flash bulbs down town.


Ingredients
1. Arduino Uno
2. Micro Servo
3. 5V Regulator
4. (2) 10nf Cap
5. 12V Incandescent Bulb
6. Acrylic (Dollar Store Picture Frame)
7. 10K Potentiometer (Optional)
8. Table Salt or Baking Soda



Notation(s)
1. Discovered the miniaturization of our previous wave generator provided less opportunity for more visually amplified waves. Ended up with a beached wave...so...crap, another words. Tip; depth, shallows and angle of attack. Next FLP (2) project will approach things differently. Vodka and flames?!
2. Plain tap water is a poor electrical conductor. Added table salt and baking soda to increase conductivity. To what ratio? This much to this much by this many.
3. (Update) Attempted several further lever variations w/o any significant increase in wave pattern. Simply requires enlarged length and depth for greater motion...that's what she said.

Sketchy
// Flashing Light Prize (1)
// VijeMiller

#include <Servo.h>
Servo wave;

// Pot Analog Pin 0
int pot = A0;
// Delay Value
int val = 0;
// Servo Positions
int fro = 0;
int bac = 160;
int pos = 0;

void setup() {
Serial.begin(9600);
wave.attach(5);
wave.write(pos);
}

void loop() {
// Read Potentiometer
val = analogRead(pot);
// Print Value
Serial.println(val);
// Map Pot to Delay Value
val = map(val, 0, 1023, 0, 20);
// Print Value
Serial.println(val);
// Back
for (pos = fro; pos <= bac; pos += 1)
{
wave.write(pos);
delay(val);
}
// Forward
for (pos = bac; pos >= fro; pos -= 1)
{
wave.write(pos);
delay(val);
}
}

Archive
https://hackaday.io/project/25715-flashing-light-prize-1-arduino-wave-generator

20:32:0 107-017