charmedlabs / pixy2

Other
131 stars 98 forks source link

SOLVED: Problem with Pixy2 talking with ESP32 #1

Closed unocerobits closed 5 years ago

unocerobits commented 5 years ago

I had a lot of problems with communicattion between Pixy2 and ESP32 through UART. I'm using 32 (RX) and 33 (TX) pins in ESP32 and 1 (TX) and 3 (RX) on Pixy2.

Finally, I had solved with this rare code, that I don't understand but works:

change open function in library Pixy2UART.h with:

HardwareSerial Serial1(1); int8_t open(uint32_t arg) { Serial1.begin(19200, SERIAL_8N1, 33, 32); // If you try, only works with this config... Serial1.begin(19200, SERIAL_8N1, 32, 33); return 0; }

Tested on ccc_i2c_uart.ino example. If somebody take reasonable answer to this, share it please! Thanks!