Radio control: use the Jeti protocol to communicate between a DIY sensor and a Jeti receiver (using 9 bits one wire serial)
Diff: main.cpp
- Revision:
- 0:32193823db59
diff -r 000000000000 -r 32193823db59 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Oct 29 19:39:38 2013 +0000 @@ -0,0 +1,36 @@ +/* main program to communicate between a sensor and a Jeti Duplex receiver + Sensor assembly = pcb with processor and sensors + processor MBED lpc1768 or LPC11u34 + + Organization of the program files + main.cpp = main program - add here the s + core.h = main header file + JetiC.cpp = serial communication with jeti + + depending on the sensors + JetiMenu.cpp = Jeti Box menu for the sensor assembly + Sensor.h Sensor.cpp = read the physical sensors and compute the measures + libraries , provided by external sources, the internet community.. + one library for each sensor + + */ +#include "core.h" +#include <new> //needed for the nothrow +struct instr_data rc; //common sensor data +void init() { + rc.jetiptr = new(nothrow) JetiC(); // initialize and start the messages to the JetiBox + //rc.sensorptr = new(nothrow) Sensor(); + +} + +int main() { + init(); + while(true) { //vey simple scheduler for the sensors + if (rc.jetiptr->isAnswer()){ //process the answer from the JetiBox + //add here the code to read the sensors + //rc.jetiptr->select(); // process the answer code and/or choose a node + //rc.jetiptr->display(); //prepare the message for this node + rc.jetiptr->debug_display(); //replace the select / display above with a simple debug without any sensor + } + } +} \ No newline at end of file