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.
Fork of TAIST_modbus_copy by
main.cpp
00001 #include "mbed.h" 00002 #include "modbus.h" 00003 00004 DigitalOut myled(LED1); 00005 RawSerial pc(USBTX, USBRX); 00006 00007 void serial_callback() 00008 { 00009 uint8_t frame[6]; 00010 00011 char ch = pc.getc(); 00012 if (modbus_parser(ch, frame)) { 00013 00014 } 00015 } 00016 00017 int main() { 00018 // setup code 00019 pc.attach(serial_callback); 00020 // 1. button code 00021 // 2. timer code 00022 while(1) { 00023 // loop code 00024 myled = 1; // LED is ON 00025 wait(0.2); // 200 ms 00026 myled = 0; // LED is OFF 00027 wait(1.0); // 1 sec 00028 } 00029 }
Generated on Tue Jul 26 2022 04:50:13 by
1.7.2
