#ifndef FR_SVBServo_h #define FR_SVBServo_h #include "Arduino.h" #include #define ServoNum 18 // SoftwareSerial toServo(7,8); // RX, TX class FR_SVBServo { public: byte servo2ch[18]={11,10,9,8,7,6,5,4,3,12,13,14,15,16,17,0,1,2}; byte oldDegree[18]={90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90}; FR_SVBServo(SoftwareSerial* toServo); FR_SVBServo(SoftwareSerial* toServo,int minPW,int maxPW); boolean servoActive(); void moveServo(byte num,byte degree,int stime); void moveServoArray(byte *degree,int stime,byte starti,byte endi); byte readDegree(byte num); void readAllDegree(byte *retAngle); private: SoftwareSerial* _toServo; int lowerPW; int upperPW; int degree2time(byte degree); void init(); }; #endif