I'm currently trying to do more or less the opposite of this thread - Trying to run an APSX D1 display from an Innovate LC-1 0-5v analog output.
There's nothing in the listing on APSX's site to suggest that it takes a serial input, so when I ordered it, I was operating off the assumption it was also 0-5v.
It does come with a white wire instead of green, so that makes it a little confusing when they say it needs a serial input but say the white wire is 0-5v analog.
I have tried to use an arduino nano to convert the signal into 9600 baud 8N1 serial, single byte 90-190 (as AFR*10) but the gauge simply turns off (ex:
https://streamable.com/sgfspe) when this happens.
I've verified with Realterm that it is outputting what I want.
I tried adding the "start up code" above and it seems to flash randomly (ex.
https://streamable.com/uirepa ). Not sure if that is an improvement or not.
Code:
void setup() {
Serial.begin(9600);
Serial.write(17); //This is just a poor implementation of the startup code. I'm sure there's a better way to do it but it's fine for now.
Serial.write(28);
Serial.write(35);
Serial.write(3);
Serial.write(17);
Serial.write(28);
Serial.write(35);
Serial.write(3);
Serial.write(17);
Serial.write(28);
Serial.write(35);
Serial.write(3);
Serial.write(17);
Serial.write(28);
Serial.write(36);
Serial.write(140);
Serial.write(17);
Serial.write(28);
Serial.write(37);
Serial.write(150);
Serial.write(17);
Serial.write(28);
Serial.write(38);
Serial.write(90);
Serial.write(17);
Serial.write(28);
Serial.write(39);
Serial.write(190);
Serial.write(190);
Serial.write(190);
Serial.write(190);
Serial.write(190);
Serial.write(190);
}
void loop() {
float serialValue = 10*((2 * 0.0049*analogRead(A0)) + 9); //converting 0-1024 0-5v voltage to serial AFR
Serial.write(100); //for testing
//delay(30); // tried a delay from 10-200ms, doesn't seem to help.
//Serial.write((uint8_t) serialValue); //actual reporting function
}
Edit, tried to use Software.Serial to flip the TTL, but it didn't make any difference.
Looking for a sanity check.