-->
Page 1 of 1

multiplexing sensors output from the UART

PostPosted: Sun Feb 21, 2016 10:34 am
by mo3tazsame7
do any one knows how to multiplex sensors' readings through UART ??

Re: multiplexing sensors output from the UART

PostPosted: Sun Feb 21, 2016 12:04 pm
by danbicks
mo3tazsame7 wrote:do any one knows how to multiplex sensors' readings through UART ??


Why not wrap them all up in a Json formatted string and send.

Job Done.

Dans

Re: multiplexing sensors output from the UART

PostPosted: Mon Feb 22, 2016 4:47 am
by mo3tazsame7
U mean repeatedly sending jason files containing the data from each sensor ??...... good idea

Re: multiplexing sensors output from the UART

PostPosted: Mon Feb 22, 2016 12:23 pm
by danbicks
mo3tazsame7 wrote:U mean repeatedly sending jason files containing the data from each sensor ??...... good idea


Yes, Sample all sensor values, wrap them all up in a JSON formatted string and send e.g:

{"Sensor Humidity":"56%","Sensor Lux":"120","Sensor Temp":"24.5"}

Use AdruinoJson Library, It is really good and will allow both creation and parsing of initial string.

Hope this helps

Dans