![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
3.2.2
Dependencies: mbed
main.cpp@0:8ec06ed0e9b0, 2017-09-12 (annotated)
- Committer:
- olemh88
- Date:
- Tue Sep 12 11:34:24 2017 +0000
- Revision:
- 0:8ec06ed0e9b0
3.2.2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
olemh88 | 0:8ec06ed0e9b0 | 1 | #include "mbed.h" |
olemh88 | 0:8ec06ed0e9b0 | 2 | |
olemh88 | 0:8ec06ed0e9b0 | 3 | DigitalOut myled(LED1); |
olemh88 | 0:8ec06ed0e9b0 | 4 | Serial pc(USBTX, USBRX); |
olemh88 | 0:8ec06ed0e9b0 | 5 | int x = 0; |
olemh88 | 0:8ec06ed0e9b0 | 6 | int pulser; |
olemh88 | 0:8ec06ed0e9b0 | 7 | int main() |
olemh88 | 0:8ec06ed0e9b0 | 8 | { |
olemh88 | 0:8ec06ed0e9b0 | 9 | while(1) { |
olemh88 | 0:8ec06ed0e9b0 | 10 | pc.printf("Skriv inn antall pulser: "); |
olemh88 | 0:8ec06ed0e9b0 | 11 | pc.scanf("%d", &pulser); |
olemh88 | 0:8ec06ed0e9b0 | 12 | for(x = 0; x < pulser; x++) { |
olemh88 | 0:8ec06ed0e9b0 | 13 | myled = 1; |
olemh88 | 0:8ec06ed0e9b0 | 14 | wait_ms(500); |
olemh88 | 0:8ec06ed0e9b0 | 15 | myled = 0; |
olemh88 | 0:8ec06ed0e9b0 | 16 | wait_ms(500); |
olemh88 | 0:8ec06ed0e9b0 | 17 | |
olemh88 | 0:8ec06ed0e9b0 | 18 | } |
olemh88 | 0:8ec06ed0e9b0 | 19 | } |
olemh88 | 0:8ec06ed0e9b0 | 20 | } |