hijiri otani / Mbed 2 deprecated 7-3

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 TextLCD lcd(PTC12,PTC13,PTC16,PTC17,PTA16,PTA17);
00004 BusOut myleds(PTB8,PTB9,PTB10,PTB11,PTE2,PTE3,PTE4,PTE5);
00005 BusOut motor(PTA1,PTA2);
00006 DigitalIn p(PTB2);
00007 
00008 int main() {
00009     while(1) {
00010         if(p==1){
00011             myleds=0xff;
00012             motor=0x1;
00013             lcd.printf("ON \n");
00014             }
00015         else{
00016             myleds=0x00;
00017             motor=0x0;
00018             lcd.printf("OFF\n");
00019             }
00020     }
00021 }