Go Down

Topic: 4 digit led rs232 display (Read 109 times) previous topic - next topic

gav00353

Hi guys,I have got a display as above from edi displays( http://www.electronicdisplays.com/products-detail.asp?productNumber=21) . I am using an arduino uno and a rs232 shield from dfrobot. I got a test program from the net and modified it slightly, I wanted the display to update the time just over every second to test it.

void setup()
{
  Serial.begin(1200);
 
}
void loop()
{
  unsigned int raceTime;
  raceTime =millis();
 
 
  {
   
    Serial.println(raceTime/1000.00);
    delay (1023);
   }
  }

the transmission protocol for the display is 1200 Baud,8 data bits,1 stop bit,no parity.

The  display works the first time giving me the seconds and hundredths as i wanted, but as the program cycles it stays with the first time displayed.
If I open serial monitor then I can see the times being updated as I want, but it doesn't happen on the external diplay.
I'm new to arduino so any help would be greatly appreciated, hopefully its just something silly.
Thanks in advance.

johnwasser

You should use an unsigned long variable for millis().  The unsigned int will only store 65.535 seconds before rolling over.

Did you read the protocol manual?
http://www.electronicdisplays.com/database/files/PLC_Communication_Options_for_Electro_136890375.pdf

You are apparently supposed to send a Start of Text  (STX) character (0x02) and two address digits ("01") before your data and an End of Text (ETX) character (0x03) after the data.

Code: [Select]

    Serial.write(0x02);
    Serial.print("01");
    Serial.print(raceTime/1000.00);
    Serial.write(0x03);
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

gav00353

Thanks John, that worked perfectly.I read it needed the start text and end text character but did not know how to code it.
Thanks Again.

Go Up