yutaro okamura / Mbed 2 deprecated test2-7

Dependencies:   TextLCD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "TextLCD.h"
00003 
00004 DigitalIn p(PTB2);
00005 BusOut myled(PTB8,PTB9,PTB10,PTB11,PTE2,PTE3,PTE4,PTE5);
00006 BusOut moter(PTA1,PTA2);
00007 PwmOut pwm(PTD4);
00008 TextLCD lcd(PTC12,PTC13,PTC16,PTC17,PTA16,PTA17);
00009 
00010 int main() {
00011     while(1) {
00012         if(p==1){
00013             lcd.printf("yes\n");
00014             pwm=1.0f;
00015             moter=2;
00016             myled=0xff;
00017         }
00018         else{
00019             lcd.printf("no\n");
00020             pwm=1.0f;
00021             moter=0;
00022             myled=0x00;
00023         }
00024     }
00025 }