Skip to content

jorticus/Arduino-Serial9b

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HardwareSerial wrapper to enable 9-bit TX/RX

Provides Serial9b1 object that wraps the standard Serial1 object, and defines the following additional methods:

int16_t   read9b();
void      write9b(uint16_t b);

Usage:

void setup() {
    // Configure Serial1 for 9-bit data.
    // Do NOT use Serial1 while this is in use!
    Serial9b1.begin(9600);
}

void loop() {
    Serial9b1.write9b(0x1AA); // bit9 = 1
    Serial9b1.write9b(0x0AA); // bit9 = 0
    Serial9b1.write9b(0xAA | BIT8); // bit9 = 1 (alternative method)
    delay(10);
}

About

Extends HardwareSerial to support 9-bit data (AVR)

Topics

Resources

License

Stars

7 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors