SPort
SPort copied to clipboard
Example?
Hello, do you have any example code for your library? I would like to read a FrSky current sensor with my Arduino Nano and didn't succeed.
I haven't really used the library in a year, but this should get you started: #include <SPort.h>
SPort sport(Serial1);
void setup() { Serial.begin(9600); sport.begin(); Serial.println("SPort Example"); delay(2000); }
void loop() { delay(500); Serial.println("Vfas voltage: " + sport.getVfasVoltage()); }
ISR(TIMER2_COMPA_vect) { sport.process(); }
You will need an Arduino Mega for this, since it's using two serial ports. Good luck!