SPort icon indicating copy to clipboard operation
SPort copied to clipboard

Example?

Open magnetilo opened this issue 10 years ago • 1 comments

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.

magnetilo avatar Feb 13 '15 14:02 magnetilo

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!

zendes avatar Feb 15 '15 08:02 zendes