Arduino Code for the M034 stepper motor driver of the LEPP neutron switch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

2 years ago
  1. /*
  2. * M034.h - Library for M034
  3. * Created by brucker 22.03.2023
  4. */
  5. #ifndef M034_H
  6. #define M034_H
  7. #include <Arduino.h> // main arduino library
  8. #include <SPI.h> // Arduino SPI library
  9. /*
  10. #include "Pin_Definitions.h" // pin definitions
  11. #include <Ponoor_PowerSTEP01Library.h> // stepper motor shield library
  12. #include <SPI.h> // Arduino SPI library
  13. #include <EEPROM.h> // Arduino EEPROM library
  14. */
  15. /**********************************************************************
  16. * classes *
  17. **********************************************************************/
  18. // encoder position class
  19. class NanotecAbsolutEncoder{
  20. public:
  21. NanotecAbsolutEncoder(SPIClass *SPIPort);
  22. void readPosition(void);
  23. uint16_t getMultiturn(void);
  24. uint32_t getSingleturn(void);
  25. uint8_t getStatus(void);
  26. private:
  27. uint16_t _startbits = 0;
  28. uint16_t _multiturn = 0;
  29. uint32_t _singleturn = 0;
  30. uint8_t _status = 0;
  31. uint8_t _readBytes[7];
  32. SPIClass *_SPI;
  33. };
  34. #endif