Hi, as I am new to this forum and quite new to arduino please forgive me if doing something wrong writing my question!!!
To begin: I am using a radiation monitor which gives me a serial string once per second. To achive this I have to send a command to the detector. I am transmitting this via zigbee.
What I need: In the moment I am using as display a I2C 16x2 LCD and an arduino fio. Working fine so far. But There is more data then the display can show in one line. So I thought on splitting the stream in three parts to put the last one in the second line.
My problem(s): I have to send a complex command to the detector. The only way for me so far was in the loop with a one time function I´ve found. Works.
But now I had to give up splitting the stream. Found a lot here and elsewhere like strtok() but nothing worked. I think because I have to change the serial stream to a readable format in the loop mode via my command.
What I have: The string I get now looks like 0001 0,012 uSievert/h
It is space seperated. The first row is gowing up per second till 9999 and then restarts with 0000. Depending on the measurement, between first and second row there can be one or two spaces.
I would like to have is first one digit going up from 0 to 9, then the second row with the third row in the second line starting under the second row:
1 0,012
uSievert/h
The code:
Importing the I2C lcd
in Setup Serial.begin(9600) and lcd.begin(16,2)
In the loop mode I first send my commands via Serial.print inside executes==false / true. Then:
if (Serial.avaliable()) {
delay(100);
lcd.clear();
while (Serial.available() > 0) {
lcd.write(Serial.read());
}
}
Anyone any idea?
I am working as radiation protection officer and ths would easy up my life because I can work farther away from my surces which reduces my personal dose and arduino is much smaller than my raspi solution and needs less power so the device I´ve built is much smaller and lighter
Thanks