Hi all,
I have connected an arduino nano to an elm327 obd adapter (using rx / tx and common ground), and using the code below I am able to reat the rpm and coolant temperature.
If I put the same code on a nodemcu board (I want this because of wifi) and also same wiring and same elm327 (rx / tx and gnd) is not working anymore.
Actually is stuck in " while (!obd.init()); "
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // select the pins used on the LCD panel
#include <OBD2UART.h>
COBD obd;
void setup()
{
// we'll use the debug LED as output
// start communication with OBD-II UART adapter
obd.begin();
lcd.begin(16, 2);
// initiate OBD-II connection until success
while (!obd.init());
}
void loop()
{
int value;
obd.readPID(PID_RPM, value);
int value2;
obd.readPID(PID_COOLANT_TEMP, value2);
lcd.setCursor(0,0);
lcd.print("RPM = ");
lcd.print(value);
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print("ECT = ");
lcd.print(value2);
lcd.print(" ");
}
Any idea why? Is there any difference on nodemcu that I missed?
Thank you in advance