BrickUp API Service for Docker version.

FR_SVBServo.h 829B

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