|
Hi, Libelium-dev group,
Sorry, I ommitted 'd' through copying when I was sending last post to you. Here is the correct code:
---------------------------------------------------------------------------------------------------- uint8_t PANID[2]={0x12,0x34}; char* KEY="WaspmoteKey";
packetXBee* paq_sent; int8_t state=0; long previous=0; //char* data="WaspMote board 5!"; char data[200]; int g=0; int temperature=0,x_acc=0,y_acc=0,z_acc=0,co2=0,co=0,NH3=0,CH4=0; int No2=0; int node_id,trans_count;
...
/* Setting up the Gas Board */ SensorGas.setBoardMode(SENS_ON); //turns on SensorGas.configureSensor(SENS_CO2,1); //Setting up the CO2 sensor SensorGas.setSensorMode(SENS_ON, SENS_CO2); XBee.println("Co2 Configured"); SensorGas.configureSensor(SENS_SOCKET4B, 1, 10); //Setting up the co & H2 XBee.println("co/H2 Configured"); SensorGas.configureSensor(SENS_SOCKET3C, 1, 8); //Setting up the NH3 & H2S XBee.println("NH3/H2S Configured"); SensorGas.configureSensor(SENS_SOCKET2A, 1, 3); //Setting up the CH4 & H2 SensorGas.setSensorMode(SENS_ON, SENS_SOCKET2A); XBee.println("CH4/H2 Configured");
SensorGas.configureSensor(SENS_SOCKET2B, 1, 10); //Setting up the No2 SensorGas.setSensorMode(SENS_ON, SENS_SOCKET2B); XBee.println("No2 Configured"); ......
/*Take readings from the gas board*/ co2 = (int)(1000*SensorGas.readValue(SENS_CO2)); //reading co2 co = (int)(1000*SensorGas.readValue(SENS_SOCKET4B)); //reading co and H2 NH3 = (int)(1000*SensorGas.readValue(SENS_SOCKET3C)); //reading NH3 and H2S CH4 = (int)(1000*SensorGas.readValue(SENS_SOCKET2A)); //reading CH4 & H2 No2 = (int)(1000*SensorGas.readValue(SENS_SOCKET2B)); //reading No2 //pressure = (int)(1000*SensorGas.readValue(SENS_PRESSURE)); //reading pressure /* Copying readings into data array */ sprintf(data,"#,NodeID,%d,Count,%d,Time,%d:%d:%d,Temp,%d,X,%d,Y,%d,Z,%d,Co2,%d,Co_H2,%d,NH3_H2S,%d,CH4H2,%d,No2,%d,\n\n",node_id,trans_count,RTC.hour,RTC.minute,RTC.second,temperature,x_acc,y_acc,z_acc,co2,co,NH3,CH4,No2);
RESULTS: ------------------------------------------------------------------------------------------------------------ ~j€}3¢@i8½+R#Vx#,NodeID,1,Count,6,Time,13:32:40,Temp,23,X,36,Y,-10,Z,1052,Co2,464,Co_H2,0,NH3_H2S,0,CH4H~}3¢@i8½+RVx2,1364,No2,k
~j€}3¢@i8½*R#Vx#,NodeID,1,Count,7,Time,13:33:6,Temp,24,X,36,Y,-10,Z,1051,Co2,474,Co_H2,0,NH3_H2S,0,CH4H2~}3¢@i8½+RVx,1341,No2,1q
~j€}3¢@i8½+R#Vx#,NodeID,1,Count,8,Time,13:33:33,Temp,24,X,36,Y,-10,Z,1052,Co2,483,Co_H2,0,NH3_H2S,0,CH4H}3~}3¢@i8½+RVx2,1322,No2,q
~j€}3¢@i8½*R#Vx#,NodeID,1,Count,9,Time,13:33:59,Temp,25,X,36,Y,-10,Z,1052,Co2,487,Co_H2,0,NH3_H2S,0,CH4H~}3¢@i8½*RVx2,1312,No2,s
~j€}3¢@i8½,R#Vx#,NodeID,1,Count,10,Time,13:34:25,Temp,25,X,36,Y,-10,Z,1052,Co2,493,Co_H2,0,NH3_H2S,0,CH4-~}3¢@i8½,RVxH2,1296,No2J
~j€}3¢@i8½+R#Vx#,NodeID,1,Count,11,Time,13:34:51,Temp,26,X,36,Y,-10,Z,1051,Co2,496,Co_H2,0,NH3_H2S,0,CH4+~}3¢@i8½+RVxH2,1287,No2K
~j€}3¢@i8½#R#Vx#,NodeID,1,Count,12,Time,13:35:17,Temp,26,X,35,Y,-8,Z,1051,Co2,529,Co_H2,0,NH3_H2S,0,CH4H~}3¢@i8½%RVx2,1341,No2,v ---------------------------------------------------------------------------------------------------------------
I don't know why I am getting the results above, especially with No2 giving alphabets.
Please help.
|