https://github.com/networkjarwy1/cardkb-driver
Driver for M5stack carkb to use with esp32 programmed using esp idf
https://github.com/networkjarwy1/cardkb-driver
c esp-idf esp-idf-component esp32
Last synced: about 2 months ago
JSON representation
Driver for M5stack carkb to use with esp32 programmed using esp idf
- Host: GitHub
- URL: https://github.com/networkjarwy1/cardkb-driver
- Owner: networkjarwy1
- License: other
- Created: 2025-02-04T08:16:00.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-05-14T13:23:49.000Z (about 1 year ago)
- Last Synced: 2025-05-20T05:36:17.631Z (about 1 year ago)
- Topics: c, esp-idf, esp-idf-component, esp32
- Language: C
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# driver for M5stack cardkb I2C keyboard
## usage
### reading key
```c
#include
#include "freertos/FreeRTOS.h"
#include "cardkb.h"
void app_main() {
cardkb_init();
while (1) {
uint8_t key = cardkb_read_key();
if (key) {
// handle returned key here
}
vTaskDelay(pdMS_TO_TICKS(200));
}
}
```
### reading word
```c
#include
#include "cardkb.h"
#define WORD_SIZE 64
void app_main(){
uint8_t word[WORD_SIZE]
cardkb_init();
cardkb_read_word(&word, WORD_SIZE);
// handle returned word here
}
```
### you need to wire the cardkb to I2C bus on esp32, then using menuconfig configure how its wired and you can choose I2C frequency