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:
- irwanfikri
- Date:
- 2018-06-04
- Revision:
- 0:b462604fdb57
File content as of revision 0:b462604fdb57:
#include "mbed.h"
#include "TextLCD.h"
TextLCD lcd(D8, D9, D4, D5, D6, D7);
Serial pc(USBTX, USBRX);
DigitalIn switch1(PC_3);
int x=0;
int main() {
lcd.locate(0,0);
lcd.printf("embedded");
lcd.locate(2,1);
lcd.printf("subject");
pc.printf("embedded subject\n");
while(1) {
if(switch1 > 0.1f) {
for (x = 99; x > 65; x--){
lcd.locate(12,0);
lcd.printf("%d",x);
pc.printf("%d \n\r",x);
wait(0.5);
x=x-2;
if(switch1<0.1f){
x=66;}
}
}
else {
for (x = 99; x > 65; x--){
if(switch1>0.1f){
x=66;}
lcd.locate(12,0);
lcd.printf("%d",x);
pc.printf("%d \n\r",x);
wait(0.5);
}
}
}
}