Codificador rotatorio I2C
Colocado enBiblioteca de codificadores rotatorios I2C
La biblioteca tiene los siguientes métodos:
La biblioteca tiene los siguientes setters:
| Setter | Devoluciones | Parmes | Descripción |
| establecerRotVal() | bool | int16_t | establecer el valor del codificador rotatorio (-5000 .. + 5000) |
| establecerRotStep() | bool | int16_t | establecer el paso giratorio (1 .. 50) |
| establecerRotMin() | bool | int16_t | establecer el valor rotatorio mínimo (-5000 .. +5000) |
| establecerRotMax() | bool | int16_t | establezca el valor rotatorio máximo (-5000 .. +5000) |
| establecerTiempoRotSpin() | bool | uint8_t | establecer el valor del tiempo de centrifugado giratorio (2 .. 100 milisegundos) |
| establecercolorRGB() | bool | uint8_t, uint8_t, uint8_t | establecer el color de los 3 leds rojo, verde, azul (0 .. 255, 0 .. 255, 0 .. 255) |
| establecercolorRGB() | bool | uint32_t | establecer el color RGB de los 3 leds (0x000000 .. 0xFFFFFF) |
| establecerLedRojo() | bool | uint8_t | establecer el valor PWM del led rojo (0 .. 255) |
| establecerLedVerde() | bool | uint8_t | establecer el valor PWM del led verde (0 .. 255) |
| establecerLedAzul() | bool | uint8_t | establecer el valor PWM del led azul (0 .. 255) |
| establecerDebounceTime() | bool | uint8_t | establecer el tiempo de rebote del interruptor (5 .. 250 microsegundos) |
| establecerMidPressTime() | bool | uint16_t | establezca el tiempo de presión media del interruptor (100 .. 5000 milisegundos) |
| establecerTiempoPrensLargo() | bool | uint16_t | establezca el tiempo de pulsación larga del interruptor (300 .. 10000 milisegundos) |
| establecerModoEstablecerBit() | bool | uint8_t | establecer el bit de modo (STNG_HWROTDIR | STNG_FLIPMODE | STNG_TURNMODE) |
| establecerModoBorrarBit() | bool | uint8_t | borra el bit de modo (STNG_HWROTDIR | STNG_FLIPMODE | STNG_TURNMODE) |
| setI²Caddress() | bool | uint8_t | establezca una nueva dirección I²C para este esclavo (1 .. 127) |
| escribirComando() | bool | uint8_t | escribir un comando en el Esclavo (CMD_READCONF | CMD_WRITECONF | CMD_REBOOT) |
La biblioteca tiene los siguientes getters:
| Adquiridor | Devoluciones | Parmes | Descripción |
| obtener el estado() | uint8_t | ninguno | lee el byte de estado |
| getRotVal() | int16_t | ninguno | leer el valor del rotativo (-5000 .. +5000) |
| obtenerRotStep() | int16_t | ninguno | leer el paso rotatorio (1 .. 50) |
| obtenerRotMin() | int16_t | ninguno | leer el valor rotatorio mínimo (-5000 .. +5000) |
| obtenerRotMax() | int16_t | ninguno | leer el valor rotatorio máximo (-5000 .. +5000) |
| getRotSpinTime() | uint8_t | ninguno | leer el tiempo de centrifugado rotatorio (2 .. 100 milisegundos) |
| obtenerQuienSoy() | int8_t | ninguno | leer el registro de direcciones |
| obtenerLedRojo() | uint8_t | ninguno | lea el valor PWM del LED rojo actual (0 .. 255) |
| obtenerLedVerde() | uint8_t | ninguno | leer el valor PWM del led verde actual (0 .. 255) |
| obtenerLedAzul() | uint8_t | ninguno | lea el valor PWM del LED azul actual (0 .. 255) |
| getDebounceTime() | uint8_t | ninguno | leer el tiempo de rebote del interruptor (5 .. 250 microsegundos) |
| getMidPressTime() | uint16_t | ninguno | lea el tiempo de presión media del interruptor (100 .. 5000 milisegundos) |
| getTiempoPrensLargo() | uint16_t | ninguno | lea el tiempo de pulsación larga del interruptor (300 .. 10000 milisegundos) |
| getMajorRelease() | uint8_t | ninguno | leer el byte de versión principal de firmware (0 .. 255) |
| getMinorRelease() | uint8_t | ninguno | leer el byte de versión de firmware menor (0 .. 255) |
| getModeSettings() | uint8_t | ninguno | leer el byte de registro de Modo (0 .. 255) |
| getModeSettings() | bool | uint8_t | lea el byte de registro de modo y pruebe contra (STNG_HWROTDIR | STNG_FLIPMODE | STNG_TURNMODE) |
La biblioteca tiene los siguientes ayudantes:
| Ayudante | Devoluciones | Parmes | Descripción |
| esRotValChanged() | bool | ninguno | verdadero si el valor rotatorio ha cambiado |
| esRotValChangedUp() | bool | ninguno | verdadero si el valor rotatorio > valor anterior |
| esRotValChangedDown() | bool | ninguno | verdadero si el valor rotatorio < valor anterior |
| esBotónPresionado() | bool | ninguno | verdadero si se presiona el botón |
| esBotónQuickReleased() | bool | ninguno | verdadero si el botón se suelta antes de midPressTime |
| isButtonMidReleased() | bool | ninguno | verdadero si el botón se suelta entre midPressTime y longPressTime |
| esBotónLargoLiberado() | bool | ninguno | verdadero si el botón se suelta después de longPressTime |