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.
main.cpp
00001 #include "mbed.h" 00002 #include "Zigbee_control.h" 00003 00004 00005 00006 float numb = 3.211; 00007 00008 00009 char *float2str( float float_num); 00010 00011 char c; 00012 char *z; 00013 int main() { 00014 00015 // reset the xbees (at least 200ns) 00016 //Zigbee_setup(); 00017 00018 00019 char* x = float2str(numb); 00020 //char x[21]; 00021 int i=1; 00022 while(1) { 00023 /* 00024 send_Zigbee_string(x); 00025 wait_ms(1000); 00026 numb = numb*1.1; 00027 x = float2str(numb); 00028 if(numb>100.0) 00029 numb =1.0; 00030 00031 if(pc.readable()) 00032 { 00033 c = pc.getc(); 00034 send_Zigbee_char(c); 00035 pc.putc(c); 00036 } 00037 */ 00038 if(Zigbee_status()) 00039 { 00040 00041 z = read_Zigbee_string(); 00042 // send_Zigbee_string(z); 00043 // pc.putc(c); 00044 send_Zigbee_string(z); 00045 } 00046 00047 00048 } 00049 } 00050 00051 char *float2str( float float_num) 00052 { 00053 static char retnum[21]; // Enough for 20 digits plus NUL from a 64-bit uint. 00054 sprintf( retnum, "%f", float_num ); 00055 return retnum; 00056 } 00057
Generated on Wed Jul 20 2022 20:26:23 by
1.7.2