Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- venhy
- Date:
- 2018-01-10
- Revision:
- 1:81949e0b4a8f
- Parent:
- 0:efaf3e54119b
- Child:
- 2:b64a41a187d8
File content as of revision 1:81949e0b4a8f:
#include "mbed.h" #include "USBSerial.h" DigitalOut myled(LED1); DigitalIn dig(PTB0); AnalogIn pir(A1); USBSerial serial; int main() { float val = 0; float jedna = 50.000; float nula = 0.500; while(1) { val = float(pir); myled = dig; serial.printf("%f", 255*val); serial.printf(" "); if(dig) serial.printf("%f\r\n",jedna); else serial.printf("%f\r\n",nula); wait(0.01); } }