//This code (1) illuminates the specified on-board LED for the Seeed Studio Xiao RP2040, (2) prints the specified phrase, and (3) prints user-specified characters //Code produced by Shea Landeene for HTMAA 2023 // define LED pin [green=16; red=17; blue=25] #define PIN 25 // define time to initiate chip:program communication (arbitrary when physically connected by cable) #define BEGIN_SPEED 9600 // define time delay between commands (arbitrary when physically connected by cable) #define DELAY_SPEED 500 // uncomment following line to run command for printing specified phrase // #define PRINT_PHRASE // uncomment following line to run command for printing letters based on user input // #define PRINT_LETTERS void setup() { // put your setup code here, to run once: pinMode(PIN, OUTPUT); Serial.begin(BEGIN_SPEED); } void loop() { // put your main code here, to run repeatedly: // turn LED on digitalWrite(PIN, HIGH); delay(DELAY_SPEED); // turn LED off digitalWrite(PIN, LOW); delay(DELAY_SPEED); #ifdef PRINT_PHRASE // print specified phrase Serial.println("hello world"); #endif #ifdef PRINT_LETTERS // print specified letters based on user input if (Serial.available()) { char c = Serial.read(); Serial.print("Letter:"); Serial.println(c); Serial.println("Please enter next letter"); } #endif }