Skip to content

Conversation

cyber-murmel
Copy link

I find the control lines to be useful for out-of-band signalling e.g. for resetting a program while sending raw data as bytes over serial.

For example in this USB to OLED sketch.

#include <DigiCDC.h>
#include <DigisparkOLED.h>

void setup()
{
    SerialUSB.begin();
    oled.begin();
}

void loop()
{
    static bool rts_old = false;
    bool rts = false;

    if (SerialUSB.available()) {
        char c = SerialUSB.read();
        oled.ssd1306_send_data_byte(c);
    }

    rts = SerialUSB.getRTS();
    if (rts_old != rts) {
        rts_old = rts;
        oled.clear();
    }
}

Is this a feature you would like to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant