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:
- jksoft
- Date:
- 2011-05-21
- Revision:
- 0:ffa3929949f3
File content as of revision 0:ffa3929949f3:
#include "mbed.h"
DigitalOut led1(LED1);
DigitalOut led2(LED2);
DigitalOut led3(LED3);
DigitalOut led4(LED4);
Serial pc(USBTX, USBRX);
int main() {
char ch;
while(1) {
pc.printf("Push 1-4 Key->");
ch = pc.getc();
pc.printf("%c¥r¥n",ch);
switch(ch)
{
case '1':
led1 =! led1;
break;
case '2':
led2 =! led2;
break;
case '3':
led3 =! led3;
break;
case '4':
led4 =! led4;
break;
default:
pc.printf("Please push the key to 1-4.¥r¥n");
break;
}
}
}