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
CP Express Hardware Serial in Arduino IDE
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- crcibernetica
- Posts: 58
- Joined: Fri Apr 11, 2014 6:59 pm
- danhalbert
- Posts: 4686
- Joined: Tue Aug 08, 2017 12:37 pm
Re: CP Express Hardware Serial in Arduino IDE
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:
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');
}
- crcibernetica
- Posts: 58
- Joined: Fri Apr 11, 2014 6:59 pm
Re: CP Express Hardware Serial in Arduino IDE
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.
Please be positive and constructive with your questions and comments.