CP Express Hardware Serial in Arduino IDE

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
crcibernetica
 
Posts: 58
Joined: Fri Apr 11, 2014 6:59 pm

CP Express Hardware Serial in Arduino IDE

Post by crcibernetica »

Using CP Classic I access the USB serial port using "Serial" and the RX/TX serial using "Serial1".
The same naming does not work for me using a CP Express. What is the correct way to access the hardware serial port using the Arduino IDE?

Regards,

Ubuntu 16.04LTS
Arduino IDE 1.8.5

User avatar
danhalbert
 
Posts: 4686
Joined: Tue Aug 08, 2017 12:37 pm

Re: CP Express Hardware Serial in Arduino IDE

Post by danhalbert »

What errors are you seeing?

https://learn.adafruit.com/adafruit-cir ... -serialusb discusses one issue. As described there, you need to make sure to install both the Arduino and Adafruit SAMD M0 board packages to get `Serial` instead of `SerialUSB`.

If you want to use the non-USB Serial1, it appears on the pads labeled "RX" and "TX" (A6 and A7). I ran the simple program below (also on Ubuntu, as you did) and saw appropriate output on the TX pin with my logic analyzer:

Code: Select all

void setup() {
  Serial1.begin(9600);
}

void loop() {
  Serial1.write('a');
}

User avatar
crcibernetica
 
Posts: 58
Joined: Fri Apr 11, 2014 6:59 pm

Re: CP Express Hardware Serial in Arduino IDE

Post by crcibernetica »

I think CircuitPlayground.begin() sets up the capacitive touch pins and overwrites any Serial1 port that has been previously initialized. Using Serial.begin(9600) and Serial1.begin(9600) after CircuitPlayground.begin() seems to work.

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”