The MPSA13 drops the voltage by .7 volts so I'm actually operating the NANO at 9¼ volts to achieve the 8½ volts to the bulb.
I couldn't find any premade NANO expansion boards so I cut up some 18 x 24 hole perfboards. I can get three NANO expansion boards from one perfboard.
This is a drawing of the Mel NANO expansion board.
Here it is flashing the tower beacon.
The NANO Sketch (Program) is below, a simple copy & Paste to the Arduino IDE should work OK.
==================================================
/*
Fade
This example shows
how to fade an LED on pin 3
using the
analogWrite() function.
This example code is
in the public domain.
More info:
http://www.ardumotive.com/how-to-fade-an-led-en.html
*/
int led = 3;
// the pin that the LED is attached to
int brightness = 0;
// how bright the LED is
int fadeAmount = 5;
// how many points to fade the LED by
// the setup routine runs once when you press reset:
void setup() {
// declare pin 3 to
be an output:
pinMode(led,
OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// set the
brightness of pin 3:
analogWrite(led,
brightness);
// change the
brightness for next time through the loop:
brightness =
brightness + fadeAmount;
// reverse the
direction of the fading at the ends of the fade:
if (brightness == 0
|| brightness == 255) {
fadeAmount =
-fadeAmount ;
}
// wait for 30
milliseconds to see the dimming effect
delay(30);
}
==================================================
No comments:
Post a Comment