PowerBroker2 / ELMduino

Arduino OBD-II Bluetooth Scanner Interface Library for Car Hacking Projects
MIT License
673 stars 125 forks source link

Renew Elmduino-ELM327 Connection setup in main Loop #261

Open MFAISALREHMAN opened 2 months ago

MFAISALREHMAN commented 2 months ago

Hello The Elmduino-ELM327 connect function is called in Setup function. However i want it in Loop function.

During operation if connection between Arduino and Elm327 is lost e.g if i plug out elm327 and then reconnect, then data cannot be read until new connection is established between Arduino and elm327. Can someone suggest the code snippet for that.

Thanks

miguelos6 commented 1 month ago

I created testConnectivity() function at the end of loop () it simply does the same as in setup () but has condition if (!myELM327.connected) { connect steps from setup() here }