Find Jobs
Hire Freelancers

A simple reading from serial interface

$30-250 USD

Terminado
Publicado hace alrededor de 14 años

$30-250 USD

Pagado a la entrega
I currently have a network of wireless 6 Zigbee modules sending temperature readings data to a central Zigbee coordinator. At present these temperatures are being read through serial monitor and as they are coming through very quickly and in vast amount they are difficult to follow. What I would like is an interface that looks like this [login to view URL];current=[login to view URL] basically i need 6 boxes that read the address of the sending zigbee and display the temperature also I would like this temperature saving to an output file. The zigbees are connected to arduino boards and here is the code that operate them Arduino code for Coordinator operating in API mode #include <XBee.h> // include library available at: [login to view URL] #include <NewSoftSerial.h> // include library available at: [login to view URL] uint8_t ssRX = 9; uint8_t ssTX = 10; NewSoftSerial nss(ssRX, ssTX); XBee xbee = XBee(); XBeeResponse response = XBeeResponse(); // create reusable response objects for responses we expect to handle ZBRxResponse rx = ZBRxResponse(); ModemStatusResponse msr = ModemStatusResponse(); int statusLed = 13; int errorLed = 13; int dataLed = 13; int B=4090; float T1 = 298.15; float RT1 = 33000; float RT2 = 0; float T2 = 0; void printDouble( double val, unsigned int precision){ /* This function prints val with number of decimal places determine by precision*/ [login to view URL] (int(val)); //prints the int part [login to view URL]("."); // print the decimal point unsigned int frac; if(val >= 0) frac = (val - int(val)) * precision; else frac = (int(val)- val ) * precision; [login to view URL](frac,DEC) ; } void setup() { pinMode(statusLed, OUTPUT); pinMode(errorLed, OUTPUT); pinMode(dataLed, OUTPUT); // start serial [login to view URL](9600); // start soft serial [login to view URL](9600); } void loop() { // keep on reading until it receives a packet [login to view URL](); if ([login to view URL]().isAvailable()) { // have picked up something if ([login to view URL]().getApiId() == ZB_RX_RESPONSE) { // got a zigbee rx packet // fills the zigbee rx class [login to view URL]().getZBRxResponse(rx); [login to view URL]("Received Packet From: "); //prints source address of the transmitting device [login to view URL]([login to view URL]().getMsb(), HEX); [login to view URL]([login to view URL]().getLsb(), HEX); [login to view URL](""); } byte dataByte1 = ([login to view URL]().getFrameData()[11]); byte dataByte2 = ([login to view URL]().getFrameData()[12]); unsigned int value = dataByte2; value = value | (dataByte1 << 8);// uses the endian to rejoin the 2 bytes into 1 float int Temp = value;//make the value a integer //same temperature calculations as AT mode RT2 = (RT1*(1024 - Temp))/Temp; T2 = (B*T1)/(B-(T1*log(RT1/RT2))); T2 = T2 - 273.15; [login to view URL]("Temperature is: "); printDouble(T2,100); [login to view URL]("°C"); [login to view URL](""); [login to view URL]("-------------------------------------"); [login to view URL](""); // set dataLed PWM to value of the first byte in the data analogWrite(dataLed, [login to view URL](0)); } else if ([login to view URL]().getApiId() == MODEM_STATUS_RESPONSE) { [login to view URL]().getModemStatusResponse(msr); // the local XBee sends this response on certain events, like association/dissociation } } End Device operating in API mode #include <XBee.h> // create the XBee object XBee xbee = XBee(); uint8_t payload[] = { 0, 0 }; // insert SH + SL Address of receiving XBee XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0x40320721); ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload)); ZBTxStatusResponse txStatus = ZBTxStatusResponse(); int pin5 = 0; int statusLed = 13; int errorLed = 13; void flashLed(int pin, int times, int wait) { for (int i = 0; i < times; i++) { digitalWrite(pin, HIGH); delay(wait); digitalWrite(pin, LOW); if (i + 1 < times) { delay(wait); } } } void setup() { pinMode(statusLed, OUTPUT); pinMode(errorLed, OUTPUT); [login to view URL](9600); } void loop() { // break down 10-bit reading into two bytes and place in payload pin5 = analogRead(5); payload[0] = pin5 >> 8 & 0xff; payload[1] = pin5 & 0xff; [login to view URL](zbTx); // flash TX indicator flashLed(statusLed, 1, 100); // after sending a tx request, we expect a status response // wait up to half second for the status response if ([login to view URL](500)) { // got a response! // should be a znet tx status if ([login to view URL]().getApiId() == ZB_TX_STATUS_RESPONSE) { [login to view URL]().getZBTxStatusResponse(txStatus); // get the delivery status, the fifth byte if ([login to view URL]() == SUCCESS) { // success. time to celebrate flashLed(statusLed, 5, 50); } else { // the remote XBee did not receive our packet. is it powered on? flashLed(errorLed, 3, 500); } } } else { // local XBee did not provide a timely TX Status Response -- should not happen flashLed(errorLed, 2, 50); } delay(10000); }
ID del proyecto: 674481

Información sobre el proyecto

10 propuestas
Proyecto remoto
Activo hace 14 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hello, I'm interested in your project, Please check PMB for more details.
$160 USD en 8 días
4,6 (18 comentarios)
4,3
4,3
10 freelancers están ofertando un promedio de $189 USD por este trabajo
Avatar del usuario
Please check PMB
$200 USD en 5 días
4,9 (42 comentarios)
6,2
6,2
Avatar del usuario
Please chk ur PMB
$300 USD en 7 días
5,0 (2 comentarios)
4,1
4,1
Avatar del usuario
Sir, I am working in VB for the past 4 years and is very comfortable in doing such kind of project. Looking forward to hear from you. Thanks
$150 USD en 5 días
5,0 (3 comentarios)
2,7
2,7
Avatar del usuario
Please see my PMB. Regards.
$300 USD en 7 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Dear Sir, Mentor ICT is an Australian company based in Sydney-Australia We are specialized in ICT (Information & Communication Technology) services including Custom software, Website development and ICT project Management We have outstanding experience dealing with Serial/Parallel/LAN and Modem communications please read your PMB for more details Regards George Kerollos PMP Projects Manager Mentor ICT
$250 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Please check your PMB. Thanks
$130 USD en 15 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
i am experienced programmer in a cad/cam company. I can do every project if the documentation is enough. I can do this project as a hobby.
$30 USD en 4 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Please, check your PM.
$170 USD en 3 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED KINGDOM
oxford, United Kingdom
5,0
2
Forma de pago verificada
Miembro desde abr 30, 2010

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.