Replies: 3 comments 3 replies
-
You don't need tinySoftwareSerial. AttinyCore has built in softwareserial called Serial. So Serial.begin(xxxx) will start serial communication and if you want to use the pins as GPIO just call Serial.end() and do with the pins what you want. Then call Serial.begin() again to print etc.. |
Beta Was this translation helpful? Give feedback.
-
Something like this.
|
Beta Was this translation helpful? Give feedback.
-
All ATTinyCore parts supported by this core will always have a serial port called Serial. If there are hardware serial port(s), Serial will be Serial as God intended it. Otherwise, they will be software serial, an instance of tinySoftSerial. There is no need to include anything for this, it is part of the core to aid in migration of code from stuff with hardware serial. Just remember that it's being called Serial doesn't change the fact that it's a software serial port, with all the bullshit that normally entails (Fairly limited range of baud rates that work, it's half duplex, all transmit is blocking immediately (rather than running in the background driven by interrupts like normal serial), and while either sending or receiving, the device cannot do anything else. |
Beta Was this translation helpful? Give feedback.
-
I want to use PB0, and PB1 for Uart, but also be able to switch back within my sketch on attiny85 to control LED connected to those Pins.
I know RX for TinySoftwareSerial uses analog comparator interrupt...
Is there an easy way to use those pins for Serial, then disable that comparator and switch the pins back to general usage, like controlling LED or input?
I saw mention of this around the repository in there but no example on how to do it
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions