Dear all,
I am having some difficulties with writing a program which has 4 push to make switches and a pot as the input and 3 LEDs + buzzer as the output.
I am attaching a picture of my PCB below although I appreciate this may not be helpful so I will also attempt to explain the function.
It is a bit complex so if it needs explaining again I am of course happy to do so and apologise if it is confusing.
1. So, the user turns the device on
2. The press PTM (push to make) number 1 to activate mode 1.
3. In mode 1, the 3 LEDs come on at a "slow" fixed intervals.
4. Each LED has a corresponding PTM (out of the three remaining ones).
5. When the LED comes on, the corresponding PTM must be hit.
6. When the PTM is hit, (goes high), then the LED goes off and the buzzer sounds. This happens every time in later modes too.
7. Then another LED comes at the same "slow" fixed intervals and the process repeats
8. The user then uses the potentiometer to shorten the rate at which the LEDs come on - i.e they come on faster.
9. They can then press PTM number 1 again to move to mode 2
10. In this mode the LEDs come on randomly/random intervals but otherwise this is the same as mode 1.
11. The user presses PTM 1 to mode to mode 3
12. In this mode, the PIC measures 20 seconds.
13. The user uses the pot to set a setting - EASY MED or HARD (for example)
14. Each setting has a corresponding number eg. 10 hits, 20 hits, 30 hits
15. The user have to try and hit the PTMs as many times as they can in 20 seconds (but cannot hit the same PTM every time).
16. If the user hits the required number in the time, the buzzer beeps a couple of times.
17. Pressing PTM 1 again goes back to mode 1.
I wanted to write a code for the above function in Picaxe editor for a Picaxe 14M2
Many many thanks in advance to everyone,
Best wishes,
I am having some difficulties with writing a program which has 4 push to make switches and a pot as the input and 3 LEDs + buzzer as the output.
I am attaching a picture of my PCB below although I appreciate this may not be helpful so I will also attempt to explain the function.
It is a bit complex so if it needs explaining again I am of course happy to do so and apologise if it is confusing.
1. So, the user turns the device on
2. The press PTM (push to make) number 1 to activate mode 1.
3. In mode 1, the 3 LEDs come on at a "slow" fixed intervals.
4. Each LED has a corresponding PTM (out of the three remaining ones).
5. When the LED comes on, the corresponding PTM must be hit.
6. When the PTM is hit, (goes high), then the LED goes off and the buzzer sounds. This happens every time in later modes too.
7. Then another LED comes at the same "slow" fixed intervals and the process repeats
8. The user then uses the potentiometer to shorten the rate at which the LEDs come on - i.e they come on faster.
9. They can then press PTM number 1 again to move to mode 2
10. In this mode the LEDs come on randomly/random intervals but otherwise this is the same as mode 1.
11. The user presses PTM 1 to mode to mode 3
12. In this mode, the PIC measures 20 seconds.
13. The user uses the pot to set a setting - EASY MED or HARD (for example)
14. Each setting has a corresponding number eg. 10 hits, 20 hits, 30 hits
15. The user have to try and hit the PTMs as many times as they can in 20 seconds (but cannot hit the same PTM every time).
16. If the user hits the required number in the time, the buzzer beeps a couple of times.
17. Pressing PTM 1 again goes back to mode 1.
I wanted to write a code for the above function in Picaxe editor for a Picaxe 14M2
Many many thanks in advance to everyone,
Best wishes,
Last edited: