![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
3.2.4
Dependencies: mbed
Revision 0:a7425af6fdde, committed 2017-09-12
- Comitter:
- olemh88
- Date:
- Tue Sep 12 12:12:43 2017 +0000
- Commit message:
- 3.2.4;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Sep 12 12:12:43 2017 +0000 @@ -0,0 +1,44 @@ +#include "mbed.h" + +DigitalOut Led1(LED1); +DigitalOut Led4(LED4); + +Serial pc(USBTX, USBRX); +int x = 0; +int pulser; +int ms; +int LED; + +int main() +{ + while(1) { + int z = Led1; + int y = Led4; + z = 1; + y = 4; + pc.printf("Skriv inn antall pulser: "); + pc.scanf("%d", &pulser); + pc.printf("Skriv inn antall ms: "); + pc.scanf("%d", &ms); + pc.printf("Velg hvilken diode som skal lyse Led1 eller led4: "); + pc.scanf("%d", &LED); + if ( LED != 1 || 4) { + pc.printf("Prov igjen, feil valg\n"); + } + for(x = 0; x < pulser; x++) { + if (LED == x) { + Led1 = 1; + wait_ms(ms); + Led1 = 0; + wait_ms(ms); + } + if (LED == y) { + Led4 = 1; + wait_ms(ms); + Led4 = 0; + wait_ms(ms); + } + } + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Sep 12 12:12:43 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a330f0fddbec \ No newline at end of file