Boas pessoal,
Eu estou a procura de alguma ajuda para resolver uns exercícios de arduino para a escola. Pois so me falta a disciplina de microprocessador para finalizar o curso.. e como tal nos nessa disciplina temos um modulo que e aprender a programar o arduino!
Eu tenho aqui alguns exercicios que não conseui resolver, se alguem me conseguir ajudar a fazer e tentar meter nos comentarios uma breve explicação agradecia imenso.
Eu sei que quem domina arduino e a programação vão achar estes exercícios muito facil de fazer ...
EX.1
Read potentiometer & show value in 7-
segment display
Read value from potentiometer (0-1023)
Display corresponding value (00-99) in 7-
segment display
Hints:
1) You have to convert a decimal value (0-99) into BCD.
Convert each digit at time. For example
• 75: you first convert 7 into BCD, then you convert 5 into BCD
2) To display 2X7-segments in the IDL800A you need to
“multiplex” the 7-seg display. For example
• 75: to display 7, you set the BCD code for 7, “activate” left 7-seg
display (cathode low), “deactivate” right 7-seg display (cathode
high) and wait sometime (about 10 ms)
• Then you set the BCD code for 5, “deactivate” left 7-seg display,
“activate” right 7-seg display and wait sometime (about 10ms)
EX.2
Count up/down:
Display number on 7 segments
• Start at 00
If push button A is pressed
• Count up
If push button B is pressed
• Count down
When the counter is at 99, and button A is
pressed, display must go to 00.
When the counter is at 00, and button B is
pressed, display must go to 99.
EX.3
Counter up and reset:
Display number on 7 segments
• Start at 00
Every second the counter goes up (do
NOT use the function delay())
If push button A is pressed counter is
reset, i.e. goes to 00 (use interrupts)
EX.4
Read potentiometer:
Read potentiometer
Use LEDs to display value of pot
LED 1: pot 1/8 max value
LED 2: pot 2/8 max value
LED 3: pot 3/8 max value
LED 4: pot 4/8 max value
LED 5: pot 5/8 max value
LED 6: pot 6/8 max value
LED 7: pot 7/8 max value
LED 8: pot equal max value
Obrigado pessoal