Find Jobs
Hire Freelancers

A simple reading from serial interface

$30-250 USD

Selesai
Dibuat sekitar 14 tahun yang lalu

$30-250 USD

Dibayar ketika dikirim
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 Proyek: 674481

Tentang proyek

10 proposal
Proyek remot
Aktif 14 tahun yang lalu

Ingin menghasilkan uang?

Keuntungan menawar di Freelancer

Tentukan anggaran dan garis waktu Anda
Dapatkan bayaran atas pekerjaan Anda
Uraikan proposal Anda
Gratis mendaftar dan menawar pekerjaan
Diberikan kepada:
Avatar Pengguna
Hello, I'm interested in your project, Please check PMB for more details.
$160 USD dalam 8 hari
4,6 (18 ulasan)
4,3
4,3
10 freelancer menawar dengan rata-rata $189 USD untuk pekerjaan ini
Avatar Pengguna
Please check PMB
$200 USD dalam 5 hari
4,9 (42 ulasan)
6,2
6,2
Avatar Pengguna
Please chk ur PMB
$300 USD dalam 7 hari
5,0 (2 ulasan)
4,1
4,1
Avatar Pengguna
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 dalam 5 hari
5,0 (3 ulasan)
2,7
2,7
Avatar Pengguna
Please see my PMB. Regards.
$300 USD dalam 7 hari
0,0 (0 ulasan)
0,0
0,0
Avatar Pengguna
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 dalam 1 hari
0,0 (0 ulasan)
0,0
0,0
Avatar Pengguna
Please check your PMB. Thanks
$130 USD dalam 15 hari
0,0 (0 ulasan)
0,0
0,0
Avatar Pengguna
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 dalam 4 hari
0,0 (0 ulasan)
0,0
0,0
Avatar Pengguna
Please, check your PM.
$170 USD dalam 3 hari
0,0 (0 ulasan)
0,0
0,0

Tentang klien

Bendera UNITED KINGDOM
oxford, United Kingdom
5,0
2
Memverifikasi Metode pembayaran
Anggota sejak Apr 30, 2010

Verifikasi Klien

Terima kasih! Kami telah mengirim Anda email untuk mengklaim kredit gratis Anda.
Anda sesuatu yang salah saat mengirimkan Anda email. Silakan coba lagi.
Pengguna Terdaftar Total Pekerjaan Terpasang
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuat pratinjau
Izin diberikan untuk Geolokasi.
Sesi login Anda telah kedaluwarsa dan Anda sudah keluar. Silakan login kembali.