Home › Forums › Mayfly Data Logger › Reposting: Library extension "Mod" › Reply To: Reposting: Library extension "Mod"
2017-08-07 at 8:50 PM
#2325
If you don’t want to be limited as to which pin each library can control, you can set the pin change interrupt as “master” and use a different version of software serial that has been stripped of all interrupt register control: https://github.com/EnviroDIY/SoftwareSerial_ExternalInts.
You could also use AltSoftSerial instead of SoftwareSerial because it doesn’t need interrupts. It can only be used with pin D6 as the receiver and D5 as the transmitter. You cannot use pin D4 if using AltSoftSerial.
To use AltSoftSerial with a Mayfly or Mbili you must add these lines to the top of your sketch:
1 2 3 4 |
#define ALTSS_USE_TIMER1 #define INPUT_CAPTURE_PIN 6 // receive #define OUTPUT_COMPARE_A_PIN 5 // transmit #define OUTPUT_COMPARE_B_PIN 4 // unusable PWM |