adafruit / Adafruit_NeoTrellisM4

Example sketches for the NeoTrellis M4 board
51 stars 34 forks source link

A classic serial UART ( not midi ) #17

Open LoicLac opened 5 years ago

LoicLac commented 5 years ago

Hello , I'd like to connect NeoTrellis via a SERIAL UART to communicate with another arduino board . a classic serial Tx Rx ... I understand in the documentation that there is a port with sda and scl on a STEMMA output format ( that i used very well with midi ) . How to enable it in the arduino IDE ? A place to start digging ? some tips ? Thank you ! Loic L

neoncyber2001 commented 3 years ago

From what i see by browsing the code. it looks like the STEMMA is connected to the UART by default using Serial1. so you should be able to use:

Serial1.begin(baud); //replace 'baud' with your desired port speed.

That should start it up as a regular serial port. in the library the enableUARTMIDI(bool) method does this exactly using the standard MIDI baud rate, really the only other thing it does is it sets a flag which is used so that it knows to transmit midi over Serial1 and not USB. If your unfamiliar with Serial1, it works just like Serial, it's Arduino's solution for dealing with chips that have multiple UART connections. Arduino Reference