Here you can find samples for Arduino Uno.
You have 8 digit LED display. Digits have such a view:
___________________________
/ \
| a Also there |
| ___ ground pin |
| f | | b should be. |
| |___| |
| e | g | c |
| |___|. |
| \ |
| d dp (point digit)|
\___________________________/
Using Arduino IDE, load SAMPLE1.ino
on the board.
So now you can see algorithm in work.
It counts from 0 to 9, then digit point lights on and it goes down from 9 to 0.
Reaching 0 loop repeats.
Working idea is similar to SAMPLE1.ino
.
But we can use serial monitor, which supports commands like :
pause on
- pauses (freezes) the LED display, but the counter continues counting.pause off
- keeps going (unfreeze) the LED display. It unfreezes with a current counter value.delay %time
- set time for showing one numeralreset
help
- show help dialog
- add new enum value in
enum LED_CMD
(eg.COMMAND
) - add
#define COMMAND_STR "command\0"
- max 8 digits - add
#define VALUE_STR "val\0"
- max 4 digits - add declaration and implementation for
bool check_COMMAND(Command \*)
- add
if(check_COMMAND(cmd)) return;
toinitCommand
- add
case COMMAND:
toswitch(cmd->led_cmd)
inloop()