NamNam
Hi community,
Im build a board ESP32 for my application, Im just start with OpenPLC short time ago.
Im want set pin ESP32 at LOW(0V) via OpenPLC, but result is HIGH (3.3V).
Can anyone address me why it wrong?
Không có mô tả.Không có mô tả.

Thank all!
Reply 0 0
thiagoralves
Hardware pins could have inverted polarity in the board. In any case, it is just a matter of inverting the outputs on the ESP32 driver (editor/arduino/src/hal/esp32.cpp). Ideally, it would be even better to create a driver for this board and add it as a new entry on editor/arduino/examples/Baremetal/hals.json
Reply 0 0
NamNam
Hi bro Thiagoralves,
Thanks for your reply.
I mean, it inverted with:
 
digitalWrite(21, HIGH);
 
With this line, level of pin IO21 actualy at HIGH. So i think noproblem with hal of esp32.
 
Im guess have setting in OpenPLC, which can set logic active for component DI1 to DI8 in OpenPLC, im not sure.
I can show schematic board at here if you or anyone need.
Are you have any info about this issue?
Thanks for your effort. 
Reply 0 0
thiagoralves
Just invert the logic on the HAL driver itself, on all the digitalWrite calls (place a ! before the bool variable) and you will be good.
Reply 0 0
NamNam
Just invert the logic on the HAL driver itself, on all the digitalWrite calls (place a ! before the bool variable) and you will be good.
Thank bro, Do it in OpenPLC right?
Can you address me correct file need edit?

Reply 0 0
thiagoralves
editor/arduino/src/hal/esp32.cpp
Reply 1 0
NamNam
editor/arduino/src/hal/esp32.cpp
Thank you.
Do it as you said.
Success!
Reply 0 0
Reply