| 57 | |
| 58 | #if defined (ESP8266) || defined(ESP32) |
| 59 | bool AS5600::begin(int dataPin, int clockPin, uint8_t directionPin) |
| 60 | { |
| 61 | _directionPin = directionPin; |
| 62 | if (_directionPin != 255) |
| 63 | { |
| 64 | pinMode(_directionPin, OUTPUT); |
| 65 | } |
| 66 | setDirection(AS5600_CLOCK_WISE); |
| 67 | |
| 68 | _wire = &Wire; |
| 69 | if ((dataPin < 255) && (clockPin < 255)) |
| 70 | { |
| 71 | _wire->begin(dataPin, clockPin); |
| 72 | } else { |
| 73 | _wire->begin(); |
| 74 | } |
| 75 | if (! isConnected()) return false; |
| 76 | return true; |
| 77 | } |
| 78 | #endif |
| 79 | |
| 80 |