mbedを用いた制御学生の制御
/
Watashi_transmit
nhk2015-Nara
main.cpp
- Committer:
- eil4nyqn
- Date:
- 2015-10-18
- Revision:
- 0:fc9767a38ca3
File content as of revision 0:fc9767a38ca3:
#include "mbed.h" #include "ACM1602NI.h" Serial conn2(p13,p14); ACM1602NI lcd(p28,p27); BusIn XYAB(p5,p6,p7,p8); BusIn cross(p9,p10,p11,p12); AnalogIn left(p15); AnalogIn Right(p17); AnalogIn RH(p18); AnalogIn LH(p16); BusIn JST(p23,p24); BusIn SB(p29,p30); BusIn other(p21,p22); AnalogIn LT(p20); AnalogIn RT(p19); DigitalOut led(p26); DigitalOut led2(p25); int main() { XYAB.mode(PullUp); other.mode(PullUp); SB.mode(PullUp); JST.mode(PullUp); cross.mode(PullUp); uint8_t i,n,m,p,q; double z,x,c,v,g,j; uint8_t num=0; lcd.printf("Game Start\n"); wait(1); while(1) { /*ボタン読み取り*/ i = XYAB; n = cross; m = JST; p = SB; q = other; z = left; x = Right; c = LT; v = RT; g = RH; j = LH; /*代入*/ num = p; /*送信*/ conn2.putc(num); /*LCD*/ lcd.printf("Wasyoi!Wasyoi!\n"); lcd.printf("NIT Nagaoka\n"); printf("%d\n\r",num); //printf("%d-%d-%d-%d-%d--%lf-%lf-%lf-%lf-%lf-%lf\r\n",i,n,m,p,q,z,x,c,v,j,g); } }