Hi
I have been trying to make a clock out of Arduino Mega 2560 using the already example of "Analog Write Mega".
The point is that i don´t know how to programme but i really want to make this clock.
The idea is this:
I have a normal wall clock that i´m going to put LED under every number, 12 LED´s.
1 LED is going to shine at a time (hehe time...) for example if it is 5 o clock then the LED is going to shine at 5. Then the whole time it is going to shine at 5 o clock and when it´s starting to change to 6 o clock then the LED is going to dime down just 5 second and then the number 6 is starting to shine up.
It´s supposed to work as a normal clock but the hour hand is removed. That is where the LED comes into picture.
This is the already finished programme in Arduino:
Mega analogWrite() test
This sketch fades LEDs up and down one at a time on digital pins 2 through 13.
This sketch was written for the Arduino Mega, and will not work on other boards.
The circuit:
- LEDs attached from pins 2 through 13 to ground.
created 8 Feb 2009
by Tom Igoe
This example code is in the public domain.
*/
// These constants won't change. They're used to give names to the pins used:
const int lowestPin = 2;
const int highestPin = 13;
void setup() {
// set pins 2 through 13 as outputs:
for (int thisPin = lowestPin; thisPin <= highestPin; thisPin++) {
pinMode(thisPin, OUTPUT);
}
}
void loop() {
// iterate over the pins:
for (int thisPin = lowestPin; thisPin <= highestPin; thisPin++) {
// fade the LED on thisPin from off to brightest:
for (int brightness = 0; brightness < 255; brightness++) {
analogWrite(thisPin, brightness);
delay(2);
}
// fade the LED on thisPin from brightest to off:
for (int brightness = 255; brightness >= 0; brightness--) {
analogWrite(thisPin, brightness);
delay(2);
}
// pause between LEDs:
delay(100);
}
}
I don´t know how to make this happend but i hope someone out there can help me with this.
The example of "Analog Write Mega" is not the one that works it´s only my closest one yet.
I´m also having trouble with this:
If i want to set the time then i have to make maybe some buttons to press for Hour, Minute and second. I haven´t bought that yet and i don´t know if it´s gonna work since i need a display for that, well that´s what i think.
What do you think?
Best regards
Filip