EB_Bluetooth.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /***************************************************
  2. This is a library for the EB-Bluetooth
  3. The EB-Bluetooth uses software seiral and one extra pin for checking state.
  4. MakerStudio invests time and resources providing this open source code,
  5. please support MakerStudio and open-source hardware by purchasing
  6. products from MakerStudio!
  7. Written by Steve for MakerStudio.
  8. BSD license, all text above must be included in any redistribution
  9. ****************************************************/
  10. #ifndef _EB_BLUETOOTH_H
  11. #define _EB_BLUETOOTH_H
  12. #include <Arduino.h>
  13. #include <SoftwareSerial.h>
  14. #include <WString.h>
  15. class EB_Bluetooth{
  16. public:
  17. EB_Bluetooth(uint8_t EB_Rx, uint8_t EB_Tx);
  18. EB_Bluetooth(uint8_t EB_Rx, uint8_t EB_Tx, uint8_t EB_INT);
  19. void begin();
  20. int setName(String name);
  21. int print(uint8_t byte);
  22. int read();
  23. int available();
  24. int connected();
  25. private:
  26. uint8_t EB_rxPin;
  27. uint8_t EB_txPin;
  28. uint8_t EB_statePin;
  29. int bluetoothState;
  30. SoftwareSerial swSerial;
  31. };
  32. #endif