I2C Rotary Encoder
Geplaatst opI2C Rotary Encoder Library
De library heeft de volgende methoden:
De library heeft de volgende setters:
Setter | Returns | Parms | Description |
setRotVal() | bool | int16_t | set the value of the Rotary Encoder (-5000 .. + 5000) |
setRotStep() | bool | int16_t | set the rotary Step (1 .. 50) |
setRotMin() | bool | int16_t | set the Minimum rotary value (-5000 .. +5000) |
setRotMax() | bool | int16_t | set the Maximum rotary value (-5000 .. +5000) |
setRotSpinTime() | bool | uint8_t | set the Rotary Spin thime value (2 .. 100 milli seconds) |
setRGBcolor() | bool | uint8_t, uint8_t, uint8_t | set the color of all 3 leds Red, Green, Blue (0 .. 255, 0 .. 255, 0 .. 255) |
setRGBcolor() | bool | uint32_t | set the RGB color of all 3 leds (0x000000 .. 0xFFFFFF) |
setLedRed() | bool | uint8_t | set the PWM value of the Red led (0 .. 255) |
setLedGreen() | bool | uint8_t | set the PWM value of the Green led (0 .. 255) |
setLedBlue() | bool | uint8_t | set the PWM value of the Blue led (0 .. 255) |
setDebounceTime() | bool | uint8_t | set the Debounce Time of the switch (5 .. 250 micro seconds) |
setMidPressTime() | bool | uint16_t | set the Mid Press Time of the switch (100 .. 5000 milli seconds) |
setLongPressTime() | bool | uint16_t | set the Long Press Time of the switch (300 .. 10000 milli seconds) |
setModeSetBit() | bool | uint8_t | set the Mode Bit (STNG_HWROTDIR | STNG_FLIPMODE | STNG_TURNMODE) |
setModeClearBit() | bool | uint8_t | clears the Mode Bit (STNG_HWROTDIR | STNG_FLIPMODE | STNG_TURNMODE) |
setI²Caddress() | bool | uint8_t | set a new I²C address for this Slave (1 .. 127) |
writeCommand() | bool | uint8_t | write a command to the Slave (CMD_READCONF | CMD_WRITECONF | CMD_REBOOT) |
De library heeft de volgende getters:
Getter | Returns | Parms | Description |
getStatus() | uint8_t | none | reads the status byte |
getRotVal() | int16_t | none | read the value of the rotary (-5000 .. +5000) |
getRotStep() | int16_t | none | read the rotary Step (1 .. 50) |
getRotMin() | int16_t | none | read the minimum rotary value (-5000 .. +5000) |
getRotMax() | int16_t | none | read the maximum rotary value (-5000 .. +5000) |
getRotSpinTime() | uint8_t | none | read the rotary spin time (2 .. 100 milli seconds) |
getWhoAmI() | int8_t | none | read the Address Register |
getLedRed() | uint8_t | none | read the current Red led PWM value (0 .. 255) |
getLedGreen() | uint8_t | none | read the current Green led PWM value (0 .. 255) |
getLedBlue() | uint8_t | none | read the current Blue led PWM value (0 .. 255) |
getDebounceTime() | uint8_t | none | read the Debounce Time of the switch (5 .. 250 micro seconds) |
getMidPressTime() | uint16_t | none | read the Mid Press Time of the switch (100 .. 5000 milli seconds) |
getLongPressTime() | uint16_t | none | read the Long Press Time of the switch (300 .. 10000 milli seconds) |
getMajorRelease() | uint8_t | none | read the Major Firmware Release byte (0 .. 255) |
getMinorRelease() | uint8_t | none | read the Minor Firmware Release byte (0 .. 255) |
getModeSettings() | uint8_t | none | read the Mode register byte (0 .. 255) |
getModeSettings() | bool | uint8_t | read the Mode register byte and test against (STNG_HWROTDIR | STNG_FLIPMODE | STNG_TURNMODE) |
De library heeft de volgende helpers:
Helper | Returns | Parms | Description |
isRotValChanged() | bool | none | true if the Rotary Value has changed |
isRotValChangedUp() | bool | none | true if the Rotary Value > previous value |
isRotValChangedDown() | bool | none | true if the Rotary Value < previous value |
isButtonPressed() | bool | none | true if the Button is pressed |
isButtonQuickReleased() | bool | none | true if the Button is released before midPressTime |
isButtonMidReleased() | bool | none | true if the Button is released between midPressTime and longPressTime |
isButtonLongReleased() | bool | none | true if the Button is released after longPressTime |