In the "Adding more Serial Interfaces to SAMD microcontrollers (SERCOM)" tutorial, in the section for "Create a new Serial instance", the example code shows:
int sensorValue = analogRead(A0);
// print out the value you read on mySerial wired in loopback:
mySerial.write(sensorValue);
analogRead() will return values greater than 256 (assuming the resolution of the ADC is the default 10 bits) but the write() will only write a byte. This should be explained, and optionally scaled to fit in a byte.
In the "Adding more Serial Interfaces to SAMD microcontrollers (SERCOM)" tutorial, in the section for "Create a new Serial instance", the example code shows:
analogRead() will return values greater than 256 (assuming the resolution of the ADC is the default 10 bits) but the write() will only write a byte. This should be explained, and optionally scaled to fit in a byte.