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.
Dependencies: mbed
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalIn SW0(p6);//非常停止1でON 00004 DigitalIn SW1(p8); 00005 DigitalIn SW2(p11); 00006 DigitalIn SW3(p12); 00007 DigitalIn SW4(p15); 00008 DigitalIn SW5(p16); 00009 Serial Xbee1(p9, p10,19200); 00010 Serial Xbee2(p13, p14,19200); 00011 Serial Xbee3(p28, p27,19200); 00012 00013 00014 00015 int main() { 00016 SW0.mode(PullUp); 00017 SW1.mode(PullUp); 00018 SW2.mode(PullUp); 00019 SW3.mode(PullUp); 00020 SW4.mode(PullUp); 00021 SW5.mode(PullUp); 00022 00023 while(1){ 00024 //非常停止 00025 if(SW0 == 1){ 00026 Xbee1.putc('S'); 00027 Xbee1.putc('T'); 00028 Xbee1.putc('O'); 00029 Xbee1.putc('P'); 00030 Xbee2.putc('S'); 00031 Xbee2.putc('T'); 00032 Xbee2.putc('O'); 00033 Xbee2.putc('P'); 00034 Xbee3.putc('S'); 00035 Xbee3.putc('T'); 00036 Xbee3.putc('O'); 00037 Xbee3.putc('P'); 00038 } 00039 else{ 00040 Xbee1.putc('L'); 00041 Xbee2.putc('L'); 00042 Xbee3.putc('L'); 00043 } 00044 00045 00046 if(SW1 == 0){ 00047 Xbee1.putc('A'); 00048 Xbee2.putc('A'); 00049 Xbee3.putc('A'); 00050 wait_ms(10); 00051 } 00052 if(SW2 == 0){ 00053 Xbee1.putc('B'); 00054 Xbee2.putc('B'); 00055 Xbee3.putc('B'); 00056 wait_ms(10); 00057 } 00058 if(SW3 == 0){ 00059 Xbee1.putc('C'); 00060 Xbee2.putc('C'); 00061 Xbee3.putc('C'); 00062 wait_ms(10); 00063 } 00064 if(SW4 == 0){ 00065 Xbee1.putc('D'); 00066 Xbee2.putc('D'); 00067 Xbee3.putc('D'); 00068 wait_ms(10); 00069 } 00070 if(SW5 == 0){ 00071 Xbee1.putc('E'); 00072 Xbee2.putc('E'); 00073 Xbee3.putc('E'); 00074 wait_ms(10); 00075 } 00076 00077 00078 00079 00080 00081 } 00082 }
Generated on Fri Aug 5 2022 06:34:48 by
1.7.2