mbedを用いた制御学生の制御
/
Watashi_transmit
nhk2015-Nara
Revision 0:fc9767a38ca3, committed 2015-10-18
- Comitter:
- eil4nyqn
- Date:
- Sun Oct 18 02:54:34 2015 +0000
- Commit message:
- gomin
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ACM1602NI.lib Sun Oct 18 02:54:34 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/takuo/code/ACM1602NI/#661827681a12
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Oct 18 02:54:34 2015 +0000 @@ -0,0 +1,58 @@ +#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); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Oct 18 02:54:34 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa \ No newline at end of file