Serial class behaviour

aster94
Posts: 6
Joined: Wed Jan 10, 2018 3:32 pm

Serial class behaviour

Postby aster94 » Sun Aug 26, 2018 5:52 pm

hello

in many cores (at least avr and arm) the serial class could be passed as constructor for functions, example:

Code: Select all

foo(&Serial1);
how could i achieve something similar on esp32?

i tried this but it didn't work:

Code: Select all

#include <HardwareSerial.h>
HardwareSerial MySerial(1);
foo(&MySerial);
Last edited by aster94 on Mon Aug 27, 2018 8:46 pm, edited 1 time in total.

ESP_Sprite
Posts: 9040
Joined: Thu Nov 26, 2015 4:08 am

Re: Serial class behaviour

Postby ESP_Sprite » Mon Aug 27, 2018 2:51 am

Arduino (what you seem to be using) is C++, and the C++ support on ESP32s should be the same as on ARM or AVR. Can you elaborate a bit further on the error rather than just saying 'it didn't work'?

Also moving this to the Arduino subforum, as your question is specific to that.

aster94
Posts: 6
Joined: Wed Jan 10, 2018 3:32 pm

Re: Serial class behaviour

Postby aster94 » Mon Aug 27, 2018 8:48 pm

my fault, i was using a specific function of another core which i thought to be also from arduino, this could be closed/delated

Who is online

Users browsing this forum: No registered users and 77 guests