スマートコンセント(富士通 FX-5204PS)をIEEE1888 StorageにWRITEするサンプルプログラムです。
Dependencies: EthernetInterface FiapV2 HTTPClientForSOAP NTPClient TextLCD mbed-rtos mbed spxml
Fork of BlueUSB_f by
スマートコンセント(富士通 FX-5204PS)をIEEE1888 StorageにWRITEするサンプルプログラムです。
USB HUBを使用して2台利用した例です。
表示のみは http://mbed.org/users/yueee_yt/code/BlueUSB_f/で公開しています。
BlueUSBより派生していますが、BluetoothとMass Storage Classは利用できません。
2台まで確認していますが、プログラム的には10台まで接続できるようにしています。
(RTOSとの整合により難しいかもしれません)
main.cpp@3:528f73ce625e, 2012-09-28 (annotated)
- Committer:
- yueee_yt
- Date:
- Fri Sep 28 07:10:54 2012 +0000
- Revision:
- 3:528f73ce625e
- Parent:
- 2:32a2d06f4fe2
- Child:
- 5:96a70a8cebb9
PowerTap Error Generate
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
peterbarrett1967 | 0:606b230e5b4a | 1 | /* |
peterbarrett1967 | 0:606b230e5b4a | 2 | Copyright (c) 2010 Peter Barrett |
peterbarrett1967 | 0:606b230e5b4a | 3 | |
peterbarrett1967 | 0:606b230e5b4a | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy |
peterbarrett1967 | 0:606b230e5b4a | 5 | of this software and associated documentation files (the "Software"), to deal |
peterbarrett1967 | 0:606b230e5b4a | 6 | in the Software without restriction, including without limitation the rights |
peterbarrett1967 | 0:606b230e5b4a | 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
peterbarrett1967 | 0:606b230e5b4a | 8 | copies of the Software, and to permit persons to whom the Software is |
peterbarrett1967 | 0:606b230e5b4a | 9 | furnished to do so, subject to the following conditions: |
peterbarrett1967 | 0:606b230e5b4a | 10 | |
peterbarrett1967 | 0:606b230e5b4a | 11 | The above copyright notice and this permission notice shall be included in |
peterbarrett1967 | 0:606b230e5b4a | 12 | all copies or substantial portions of the Software. |
peterbarrett1967 | 0:606b230e5b4a | 13 | |
peterbarrett1967 | 0:606b230e5b4a | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
peterbarrett1967 | 0:606b230e5b4a | 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
peterbarrett1967 | 0:606b230e5b4a | 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
peterbarrett1967 | 0:606b230e5b4a | 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
peterbarrett1967 | 0:606b230e5b4a | 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
peterbarrett1967 | 0:606b230e5b4a | 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
peterbarrett1967 | 0:606b230e5b4a | 20 | THE SOFTWARE. |
peterbarrett1967 | 0:606b230e5b4a | 21 | */ |
peterbarrett1967 | 0:606b230e5b4a | 22 | |
peterbarrett1967 | 0:606b230e5b4a | 23 | #include "USBHost.h" |
peterbarrett1967 | 0:606b230e5b4a | 24 | #include "Utils.h" |
peterbarrett1967 | 0:606b230e5b4a | 25 | #include "FATFileSystem.h" |
yueee_yt | 2:32a2d06f4fe2 | 26 | #include "TextLCD.h" |
yueee_yt | 3:528f73ce625e | 27 | #include "EthernetInterface.h" |
yueee_yt | 3:528f73ce625e | 28 | #include "NTPClient.h" |
yueee_yt | 3:528f73ce625e | 29 | #include "fiap.h" |
yueee_yt | 3:528f73ce625e | 30 | #include "mbed.h" |
yueee_yt | 3:528f73ce625e | 31 | |
yueee_yt | 3:528f73ce625e | 32 | //#define NTPServer "ntp.nict.jp" |
yueee_yt | 3:528f73ce625e | 33 | #define NTPServer "ntp.cc.yamaguchi-u.ac.jp" |
yueee_yt | 3:528f73ce625e | 34 | |
yueee_yt | 3:528f73ce625e | 35 | EthernetInterface eth; |
yueee_yt | 3:528f73ce625e | 36 | NTPClient ntp; |
yueee_yt | 3:528f73ce625e | 37 | Ticker timer1; |
yueee_yt | 3:528f73ce625e | 38 | time_t ctTime; |
yueee_yt | 3:528f73ce625e | 39 | char timezone[] = "+09:00"; // JST |
yueee_yt | 3:528f73ce625e | 40 | char atemp1[6],atemp2[6],avolt1[6],avolt2[6],afreq1[6],afreq2[6]; |
yueee_yt | 3:528f73ce625e | 41 | char apower_a1[6],apower_a2[6],apower_b1[6],apower_b2[6],apower_c1[6],apower_c2[6],apower_d1[6],apower_d2[6]; |
yueee_yt | 3:528f73ce625e | 42 | FIAP fiap("http://192.168.1.3/axis2/services/FIAPStorage"); |
yueee_yt | 3:528f73ce625e | 43 | struct fiap_element element[]= { |
yueee_yt | 3:528f73ce625e | 44 | {"http://www.gutp.jp/SmartTap1/temp",atemp1,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 45 | {"http://www.gutp.jp/SmartTap1/volt",avolt1,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 46 | {"http://www.gutp.jp/SmartTap1/freq",afreq1,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 47 | {"http://www.gutp.jp/SmartTap1/watt_1",apower_a1,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 48 | {"http://www.gutp.jp/SmartTap1/watt_2",apower_b1,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 49 | {"http://www.gutp.jp/SmartTap1/watt_3",apower_c1,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 50 | {"http://www.gutp.jp/SmartTap1/watt_4",apower_d1,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 51 | {"http://www.gutp.jp/SmartTap2/temp",atemp2,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 52 | {"http://www.gutp.jp/SmartTap2/volt",avolt2,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 53 | {"http://www.gutp.jp/SmartTap2/freq",afreq2,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 54 | {"http://www.gutp.jp/SmartTap2/watt_1",apower_a2,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 55 | {"http://www.gutp.jp/SmartTap2/watt_2",apower_b2,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 56 | {"http://www.gutp.jp/SmartTap2/watt_3",apower_c2,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 57 | {"http://www.gutp.jp/SmartTap2/watt_4",apower_d2,NULL,NULL,NULL,NULL,NULL,NULL,timezone}, |
yueee_yt | 3:528f73ce625e | 58 | }; |
peterbarrett1967 | 0:606b230e5b4a | 59 | |
peterbarrett1967 | 0:606b230e5b4a | 60 | int MassStorage_ReadCapacity(int device, u32* blockCount, u32* blockSize); |
peterbarrett1967 | 0:606b230e5b4a | 61 | int MassStorage_Read(int device, u32 blockAddr, u32 blockCount, u8* dst, u32 blockSize); |
peterbarrett1967 | 0:606b230e5b4a | 62 | int MassStorage_Write(int device, u32 blockAddr, u32 blockCount, u8* dst, u32 blockSize); |
peterbarrett1967 | 0:606b230e5b4a | 63 | |
peterbarrett1967 | 0:606b230e5b4a | 64 | class USBFileSystem : public FATFileSystem |
peterbarrett1967 | 0:606b230e5b4a | 65 | { |
peterbarrett1967 | 0:606b230e5b4a | 66 | int _device; |
peterbarrett1967 | 0:606b230e5b4a | 67 | u32 _blockSize; |
peterbarrett1967 | 0:606b230e5b4a | 68 | u32 _blockCount; |
yueee_yt | 1:3f2890d103fb | 69 | |
peterbarrett1967 | 0:606b230e5b4a | 70 | public: |
yueee_yt | 1:3f2890d103fb | 71 | USBFileSystem() : FATFileSystem("usb"),_device(0),_blockSize(0),_blockCount(0) { |
peterbarrett1967 | 0:606b230e5b4a | 72 | } |
yueee_yt | 1:3f2890d103fb | 73 | |
yueee_yt | 1:3f2890d103fb | 74 | void SetDevice(int device) { |
peterbarrett1967 | 0:606b230e5b4a | 75 | _device = device; |
peterbarrett1967 | 0:606b230e5b4a | 76 | } |
yueee_yt | 1:3f2890d103fb | 77 | |
yueee_yt | 1:3f2890d103fb | 78 | virtual int disk_initialize() { |
peterbarrett1967 | 0:606b230e5b4a | 79 | return MassStorage_ReadCapacity(_device,&_blockCount,&_blockSize); |
peterbarrett1967 | 0:606b230e5b4a | 80 | } |
yueee_yt | 1:3f2890d103fb | 81 | |
yueee_yt | 1:3f2890d103fb | 82 | virtual int disk_write(const char *buffer, int block_number) { |
peterbarrett1967 | 0:606b230e5b4a | 83 | return MassStorage_Write(_device,block_number,1,(u8*)buffer,_blockSize); |
peterbarrett1967 | 0:606b230e5b4a | 84 | } |
yueee_yt | 1:3f2890d103fb | 85 | |
yueee_yt | 1:3f2890d103fb | 86 | virtual int disk_read(char *buffer, int block_number) { |
peterbarrett1967 | 0:606b230e5b4a | 87 | return MassStorage_Read(_device,block_number,1,(u8*)buffer,_blockSize); |
peterbarrett1967 | 0:606b230e5b4a | 88 | } |
yueee_yt | 1:3f2890d103fb | 89 | |
yueee_yt | 1:3f2890d103fb | 90 | virtual int disk_sectors() { |
peterbarrett1967 | 0:606b230e5b4a | 91 | return _blockCount; |
peterbarrett1967 | 0:606b230e5b4a | 92 | } |
peterbarrett1967 | 0:606b230e5b4a | 93 | }; |
peterbarrett1967 | 0:606b230e5b4a | 94 | |
peterbarrett1967 | 0:606b230e5b4a | 95 | void DumpFS(int depth, int count) |
peterbarrett1967 | 0:606b230e5b4a | 96 | { |
peterbarrett1967 | 0:606b230e5b4a | 97 | DIR *d = opendir("/usb"); |
yueee_yt | 1:3f2890d103fb | 98 | if (!d) { |
peterbarrett1967 | 0:606b230e5b4a | 99 | printf("USB file system borked\n"); |
peterbarrett1967 | 0:606b230e5b4a | 100 | return; |
peterbarrett1967 | 0:606b230e5b4a | 101 | } |
peterbarrett1967 | 0:606b230e5b4a | 102 | |
peterbarrett1967 | 0:606b230e5b4a | 103 | printf("\nDumping root dir\n"); |
peterbarrett1967 | 0:606b230e5b4a | 104 | struct dirent *p; |
yueee_yt | 1:3f2890d103fb | 105 | for(;;) { |
peterbarrett1967 | 0:606b230e5b4a | 106 | p = readdir(d); |
peterbarrett1967 | 0:606b230e5b4a | 107 | if (!p) |
peterbarrett1967 | 0:606b230e5b4a | 108 | break; |
peterbarrett1967 | 0:606b230e5b4a | 109 | int len = sizeof( dirent); |
peterbarrett1967 | 0:606b230e5b4a | 110 | printf("%s %d\n", p->d_name, len); |
peterbarrett1967 | 0:606b230e5b4a | 111 | } |
peterbarrett1967 | 0:606b230e5b4a | 112 | closedir(d); |
peterbarrett1967 | 0:606b230e5b4a | 113 | } |
peterbarrett1967 | 0:606b230e5b4a | 114 | |
peterbarrett1967 | 0:606b230e5b4a | 115 | int OnDiskInsert(int device) |
peterbarrett1967 | 0:606b230e5b4a | 116 | { |
peterbarrett1967 | 0:606b230e5b4a | 117 | USBFileSystem fs; |
peterbarrett1967 | 0:606b230e5b4a | 118 | fs.SetDevice(device); |
peterbarrett1967 | 0:606b230e5b4a | 119 | DumpFS(0,0); |
peterbarrett1967 | 0:606b230e5b4a | 120 | return 0; |
peterbarrett1967 | 0:606b230e5b4a | 121 | } |
peterbarrett1967 | 0:606b230e5b4a | 122 | |
peterbarrett1967 | 0:606b230e5b4a | 123 | /* |
peterbarrett1967 | 0:606b230e5b4a | 124 | Simple test shell to exercise mouse,keyboard,mass storage and hubs. |
peterbarrett1967 | 0:606b230e5b4a | 125 | Add 2 15k pulldown resistors between D+/D- and ground, attach a usb socket and have at it. |
peterbarrett1967 | 0:606b230e5b4a | 126 | */ |
peterbarrett1967 | 0:606b230e5b4a | 127 | |
peterbarrett1967 | 0:606b230e5b4a | 128 | Serial pc(USBTX, USBRX); |
peterbarrett1967 | 0:606b230e5b4a | 129 | int GetConsoleChar() |
peterbarrett1967 | 0:606b230e5b4a | 130 | { |
peterbarrett1967 | 0:606b230e5b4a | 131 | if (!pc.readable()) |
peterbarrett1967 | 0:606b230e5b4a | 132 | return -1; |
peterbarrett1967 | 0:606b230e5b4a | 133 | char c = pc.getc(); |
peterbarrett1967 | 0:606b230e5b4a | 134 | pc.putc(c); // echo |
peterbarrett1967 | 0:606b230e5b4a | 135 | return c; |
peterbarrett1967 | 0:606b230e5b4a | 136 | } |
yueee_yt | 1:3f2890d103fb | 137 | void InitUSPS(); |
yueee_yt | 1:3f2890d103fb | 138 | void USPS_Refresh(); |
yueee_yt | 1:3f2890d103fb | 139 | DigitalOut led1(LED1); |
yueee_yt | 2:32a2d06f4fe2 | 140 | DigitalOut led2(LED2); |
yueee_yt | 2:32a2d06f4fe2 | 141 | DigitalOut led3(LED3); |
yueee_yt | 2:32a2d06f4fe2 | 142 | DigitalOut led4(LED4); |
yueee_yt | 1:3f2890d103fb | 143 | Timer t; |
yueee_yt | 2:32a2d06f4fe2 | 144 | Timer t2; |
yueee_yt | 3:528f73ce625e | 145 | Timer t3; |
yueee_yt | 2:32a2d06f4fe2 | 146 | TextLCD lcd(p24, p26, p27, p28, p29, p30); |
yueee_yt | 2:32a2d06f4fe2 | 147 | extern float WattData1[],WattData2[],WattData3[],WattData4[]; |
yueee_yt | 2:32a2d06f4fe2 | 148 | extern int SerialNo[]; |
yueee_yt | 3:528f73ce625e | 149 | extern float TempData[]; |
yueee_yt | 3:528f73ce625e | 150 | extern float VoltData[]; |
yueee_yt | 3:528f73ce625e | 151 | extern float FreqData[]; |
peterbarrett1967 | 0:606b230e5b4a | 152 | int main() |
peterbarrett1967 | 0:606b230e5b4a | 153 | { |
yueee_yt | 3:528f73ce625e | 154 | int i; |
yueee_yt | 3:528f73ce625e | 155 | lcd.cls(); |
yueee_yt | 3:528f73ce625e | 156 | lcd.printf("Watting...."); |
yueee_yt | 3:528f73ce625e | 157 | |
peterbarrett1967 | 0:606b230e5b4a | 158 | pc.baud(460800); |
yueee_yt | 3:528f73ce625e | 159 | |
yueee_yt | 3:528f73ce625e | 160 | eth.init(); //Use DHCP |
yueee_yt | 3:528f73ce625e | 161 | eth.connect(); |
yueee_yt | 3:528f73ce625e | 162 | printf("%s", eth.getIPAddress()); |
yueee_yt | 3:528f73ce625e | 163 | printf("Trying to update time...\r\n"); |
yueee_yt | 3:528f73ce625e | 164 | if (ntp.setTime(NTPServer) == 0) { |
yueee_yt | 3:528f73ce625e | 165 | printf("Set time successfully\r\n"); |
yueee_yt | 3:528f73ce625e | 166 | time_t ctTime; |
yueee_yt | 3:528f73ce625e | 167 | ctTime = time(NULL); |
yueee_yt | 3:528f73ce625e | 168 | ctTime+=32400; |
yueee_yt | 3:528f73ce625e | 169 | set_time(ctTime); |
yueee_yt | 3:528f73ce625e | 170 | ctTime = time(NULL); |
yueee_yt | 3:528f73ce625e | 171 | printf("Time is set to (JST): %s\r\n", ctime(&ctTime)); |
yueee_yt | 3:528f73ce625e | 172 | printf("finish \n"); |
yueee_yt | 3:528f73ce625e | 173 | } else { |
yueee_yt | 3:528f73ce625e | 174 | lcd.locate(0,1); |
yueee_yt | 3:528f73ce625e | 175 | lcd.printf("Error"); |
yueee_yt | 3:528f73ce625e | 176 | return -1; |
yueee_yt | 3:528f73ce625e | 177 | } |
yueee_yt | 3:528f73ce625e | 178 | |
yueee_yt | 1:3f2890d103fb | 179 | InitUSPS(); |
yueee_yt | 2:32a2d06f4fe2 | 180 | USBInit(); |
yueee_yt | 2:32a2d06f4fe2 | 181 | t.start(); |
yueee_yt | 2:32a2d06f4fe2 | 182 | t2.start(); |
yueee_yt | 3:528f73ce625e | 183 | t3.start(); |
yueee_yt | 2:32a2d06f4fe2 | 184 | while(1) { |
yueee_yt | 2:32a2d06f4fe2 | 185 | USBLoop(); |
yueee_yt | 2:32a2d06f4fe2 | 186 | if(t>0.1 ) { |
yueee_yt | 2:32a2d06f4fe2 | 187 | t.start(); |
yueee_yt | 2:32a2d06f4fe2 | 188 | led4=!led4; |
yueee_yt | 2:32a2d06f4fe2 | 189 | USPS_Refresh(); |
yueee_yt | 2:32a2d06f4fe2 | 190 | } |
yueee_yt | 3:528f73ce625e | 191 | if(t2>1) { //Data to LCDText |
yueee_yt | 2:32a2d06f4fe2 | 192 | t2.start(); |
yueee_yt | 3:528f73ce625e | 193 | if(SerialNo[0]==0)led1=0; |
yueee_yt | 3:528f73ce625e | 194 | else led1=1; |
yueee_yt | 3:528f73ce625e | 195 | if(SerialNo[1]==0)led2=0; |
yueee_yt | 3:528f73ce625e | 196 | else led2=1; |
yueee_yt | 3:528f73ce625e | 197 | if(SerialNo[2]==0)led3=0; |
yueee_yt | 3:528f73ce625e | 198 | else led3=1; |
yueee_yt | 2:32a2d06f4fe2 | 199 | lcd.locate(0,0); |
yueee_yt | 2:32a2d06f4fe2 | 200 | lcd.printf("1:%4.0fW 2:%4.0fW",WattData1[0],WattData2[0]); |
yueee_yt | 2:32a2d06f4fe2 | 201 | lcd.locate(0,1); |
yueee_yt | 2:32a2d06f4fe2 | 202 | lcd.printf("3:%4.0fW 4:%4.0fW",WattData3[0],WattData4[0]); |
yueee_yt | 2:32a2d06f4fe2 | 203 | } |
yueee_yt | 3:528f73ce625e | 204 | if(t3>60) { //Data to FiapStorage |
yueee_yt | 3:528f73ce625e | 205 | t3.start(); |
yueee_yt | 3:528f73ce625e | 206 | char buffer[9]; |
yueee_yt | 3:528f73ce625e | 207 | ctTime = time(NULL); |
yueee_yt | 3:528f73ce625e | 208 | strftime(buffer,9,"%X",localtime(&ctTime)); |
yueee_yt | 3:528f73ce625e | 209 | printf("Storage Store %s \r\n",buffer); |
yueee_yt | 3:528f73ce625e | 210 | // Save to FIAPStorage |
yueee_yt | 3:528f73ce625e | 211 | struct tm t = *localtime(&ctTime); |
yueee_yt | 3:528f73ce625e | 212 | for(i=0; i<14; i++) { |
yueee_yt | 3:528f73ce625e | 213 | element[0].year=t.tm_year+1900; |
yueee_yt | 3:528f73ce625e | 214 | element[0].month=t.tm_mon+1; |
yueee_yt | 3:528f73ce625e | 215 | element[0].day=t.tm_mday; |
yueee_yt | 3:528f73ce625e | 216 | element[0].hour=t.tm_hour; |
yueee_yt | 3:528f73ce625e | 217 | element[0].minute=t.tm_min; |
yueee_yt | 3:528f73ce625e | 218 | element[0].second=t.tm_sec; |
yueee_yt | 3:528f73ce625e | 219 | } |
yueee_yt | 3:528f73ce625e | 220 | for(i=0; i<2; i++) { |
yueee_yt | 3:528f73ce625e | 221 | switch(SerialNo[i]) { |
yueee_yt | 3:528f73ce625e | 222 | case 0x1737: |
yueee_yt | 3:528f73ce625e | 223 | sprintf(atemp1,"%4.1f",TempData[i]); |
yueee_yt | 3:528f73ce625e | 224 | sprintf(avolt1,"%4.1f",VoltData[i]); |
yueee_yt | 3:528f73ce625e | 225 | sprintf(afreq1,"%4.1f",FreqData[i]); |
yueee_yt | 3:528f73ce625e | 226 | sprintf(apower_a1,"%4.0f",WattData1[i]); |
yueee_yt | 3:528f73ce625e | 227 | sprintf(apower_b1,"%4.0f",WattData2[i]); |
yueee_yt | 3:528f73ce625e | 228 | sprintf(apower_c1,"%4.0f",WattData3[i]); |
yueee_yt | 3:528f73ce625e | 229 | sprintf(apower_d1,"%4.0f",WattData4[i]); |
yueee_yt | 3:528f73ce625e | 230 | break; |
yueee_yt | 3:528f73ce625e | 231 | case 0x1871: |
yueee_yt | 3:528f73ce625e | 232 | sprintf(atemp2,"%4.1f",TempData[i]); |
yueee_yt | 3:528f73ce625e | 233 | sprintf(avolt2,"%4.1f",VoltData[i]); |
yueee_yt | 3:528f73ce625e | 234 | sprintf(afreq2,"%4.1f",FreqData[i]); |
yueee_yt | 3:528f73ce625e | 235 | sprintf(apower_a2,"%4.0f",WattData1[i]); |
yueee_yt | 3:528f73ce625e | 236 | sprintf(apower_b2,"%4.0f",WattData2[i]); |
yueee_yt | 3:528f73ce625e | 237 | sprintf(apower_c2,"%4.0f",WattData3[i]); |
yueee_yt | 3:528f73ce625e | 238 | sprintf(apower_d2,"%4.0f",WattData4[i]); |
yueee_yt | 3:528f73ce625e | 239 | break; |
yueee_yt | 3:528f73ce625e | 240 | } |
yueee_yt | 3:528f73ce625e | 241 | } |
yueee_yt | 3:528f73ce625e | 242 | fiap.post(element,1); |
yueee_yt | 3:528f73ce625e | 243 | } |
yueee_yt | 2:32a2d06f4fe2 | 244 | } |
peterbarrett1967 | 0:606b230e5b4a | 245 | } |