Skip to content
Snippets Groups Projects
Commit bbc3c934 authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

serial out

parent 4ea1c70c
No related branches found
No related tags found
No related merge requests found
serialtimetest/SDS00005.png

17.1 KiB

serialtimetest/SDS00006.png

15.7 KiB

...@@ -12,16 +12,20 @@ ...@@ -12,16 +12,20 @@
// warranty is provided, and users accept all liability. // warranty is provided, and users accept all liability.
// //
#define pinout (1 << 4) // define output pin #define pinout (1 << 30) // define output pin
void setup() { void setup() {
SerialUSB.begin(0); SerialUSB.begin(0);
Serial1.begin(460800);
SYSCTRL->OSC8M.bit.PRESC = 0; // set OSC8M clock prescaler to 1 SYSCTRL->OSC8M.bit.PRESC = 0; // set OSC8M clock prescaler to 1
REG_PORT_DIR0 |= pinout; // set output pin REG_PORT_DIR0 |= pinout; // set output pin
} }
void loop() { void loop() {
static unsigned char chr;
if (SerialUSB.available()) { if (SerialUSB.available()) {
REG_PORT_OUT0 = SerialUSB.read(); //REG_PORT_OUT0 = SerialUSB.read();
chr = SerialUSB.read();
Serial1.write(chr);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment