![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
3.1.4
Dependencies: mbed
main.cpp@0:9a3f60b3424e, 2017-09-12 (annotated)
- Committer:
- olemh88
- Date:
- Tue Sep 12 11:10:04 2017 +0000
- Revision:
- 0:9a3f60b3424e
314
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
olemh88 | 0:9a3f60b3424e | 1 | #include "mbed.h" |
olemh88 | 0:9a3f60b3424e | 2 | Serial pc(USBTX, USBRX); |
olemh88 | 0:9a3f60b3424e | 3 | BusOut teller(p21, p22, p23, p24, p25, p26); |
olemh88 | 0:9a3f60b3424e | 4 | DigitalOut bryter(p20); |
olemh88 | 0:9a3f60b3424e | 5 | |
olemh88 | 0:9a3f60b3424e | 6 | int main() |
olemh88 | 0:9a3f60b3424e | 7 | { |
olemh88 | 0:9a3f60b3424e | 8 | while(1) { |
olemh88 | 0:9a3f60b3424e | 9 | if (bryter == 0) { |
olemh88 | 0:9a3f60b3424e | 10 | for(int x = 0; x <= 15; x++) { |
olemh88 | 0:9a3f60b3424e | 11 | teller = x; |
olemh88 | 0:9a3f60b3424e | 12 | wait(0.1); |
olemh88 | 0:9a3f60b3424e | 13 | if (x == 15) { |
olemh88 | 0:9a3f60b3424e | 14 | for(int x = 15; x > 0; x--) { |
olemh88 | 0:9a3f60b3424e | 15 | teller = x; |
olemh88 | 0:9a3f60b3424e | 16 | wait(0.1); |
olemh88 | 0:9a3f60b3424e | 17 | } |
olemh88 | 0:9a3f60b3424e | 18 | } |
olemh88 | 0:9a3f60b3424e | 19 | } |
olemh88 | 0:9a3f60b3424e | 20 | } |
olemh88 | 0:9a3f60b3424e | 21 | if (bryter == 1) { |
olemh88 | 0:9a3f60b3424e | 22 | for(int x = 0; x <= 63; x++) { |
olemh88 | 0:9a3f60b3424e | 23 | teller = x; |
olemh88 | 0:9a3f60b3424e | 24 | wait(0.1); |
olemh88 | 0:9a3f60b3424e | 25 | if (x == 63) { |
olemh88 | 0:9a3f60b3424e | 26 | for(int x = 63; x > 0; x--) { |
olemh88 | 0:9a3f60b3424e | 27 | teller = x; |
olemh88 | 0:9a3f60b3424e | 28 | wait(0.1); |
olemh88 | 0:9a3f60b3424e | 29 | } |
olemh88 | 0:9a3f60b3424e | 30 | } |
olemh88 | 0:9a3f60b3424e | 31 | } |
olemh88 | 0:9a3f60b3424e | 32 | } |
olemh88 | 0:9a3f60b3424e | 33 | } |
olemh88 | 0:9a3f60b3424e | 34 | } |