LPC1768 に搭載されたLEDを順に光らせる.光ったLEDに対応したテキストをPCにシリアルで送信する.
Dependencies: mbed
main.cpp
- Committer:
- igarashi50
- Date:
- 2018-06-22
- Revision:
- 0:39a4557bbc41
File content as of revision 0:39a4557bbc41:
#include "mbed.h" DigitalOut led[]= {LED1,LED2,LED3,LED4}; Serial pc(USBTX, USBRX); int main() { while(1) { for(int i=0; i<4; i++) { led[i]=1; pc.printf("LED%d is ON\r\n",i+1); wait(1); led[i]=0; wait(1); } } }