Bertie Harte
/
app-board-Joystick_import
make public
main.cpp@1:37771e69351d, 2021-03-26 (annotated)
- Committer:
- BertieHarte
- Date:
- Fri Mar 26 10:17:36 2021 +0000
- Revision:
- 1:37771e69351d
- Parent:
- 0:0e4db18afd77
make public
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris | 0:0e4db18afd77 | 1 | #include "mbed.h" |
chris | 0:0e4db18afd77 | 2 | |
chris | 0:0e4db18afd77 | 3 | BusIn joy(p15,p12,p13,p16); |
chris | 0:0e4db18afd77 | 4 | DigitalIn fire(p14); |
chris | 0:0e4db18afd77 | 5 | |
chris | 0:0e4db18afd77 | 6 | BusOut leds(LED1,LED2,LED3,LED4); |
chris | 0:0e4db18afd77 | 7 | |
chris | 0:0e4db18afd77 | 8 | int main() |
chris | 0:0e4db18afd77 | 9 | { |
chris | 0:0e4db18afd77 | 10 | while(1) { |
chris | 0:0e4db18afd77 | 11 | if (fire) { |
chris | 0:0e4db18afd77 | 12 | leds=0xf; |
chris | 0:0e4db18afd77 | 13 | } else { |
chris | 0:0e4db18afd77 | 14 | leds=joy; |
chris | 0:0e4db18afd77 | 15 | } |
chris | 0:0e4db18afd77 | 16 | wait(0.1); |
chris | 0:0e4db18afd77 | 17 | } |
chris | 0:0e4db18afd77 | 18 | } |