tetsuya Ogata
/
Enpra_practice11
Revision 0:30bfe67b0254, committed 2013-06-06
- Comitter:
- ogata_lab
- Date:
- Thu Jun 06 06:42:00 2013 +0000
- Commit message:
- first commit;
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 Thu Jun 06 06:42:00 2013 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" +#include "Serial.h" + +Serial usbSerial(USBTX, USBRX); +PwmOut leds[4] = {LED1, LED2, LED3, LED4}; + +int main() { + float n = 0; + while(1) { + usbSerial.printf("Input Command:"); + usbSerial.scanf("%f", &n); + if (n > 1.0) n = 1.0; + else if(n < 0.0) n = 0.0; + for(int i = 0;i < 4;i++) { + leds[i].write(n); + } + usbSerial.printf("OK.¥n"); + wait(0.5); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jun 06 06:42:00 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17 \ No newline at end of file