returns true (1) if keyboard is found.
Note: This function offers a quick check if the keyboard is connected. It is recommended to use this function at the start of your application before starting reading.
void wooting_set_disconnected_cb(void_cb cb);
cb – a callback function with no return and arguments (void)
Note: The callback will be called when a Wooting keyboard disconnects. Right now this will only trigger after a failed read.
uint8_t wooting_read_analog(uint8_t row, uint8_t column);
returns the analog value of the key from 0 – 255
row – horizontal index of the key that will be read
column- vertical index of the key that will be read
Note: This function returns an analog value of a single key. The arguments are a row and column index of the keyboard array. The keyboard matrix with row columns indexing can be found in the github resources folder.
It is not necessary to initialize the keyboard before reading. If the keyboard is not connected this function will return 0. Indexes out of bound will also return 0.
int wooting_read_full_buffer(uint8_t data, unsigned int length);
returns items written or -1 on error.
data – A buffer to put the read data into (2 – 32 bytes)
length – Length of the data buffer in bytes
Note: This function can be used to get a buffer of all the keys that are pressed up to a maximum of 16 keys. The maximum size of the buffer is 32 bytes (2 bytes * 16 keys).
The data is ordered as [scan_code0, analog_value0, scan_code1, analog_value1, …. , scan_code15, analog_value15]
The keyboard matrix with scan code indexing can be found in the github resources folder.
It is not necessary to initialize the keyboard before reading. If the keyboard is not connected this function will return -1.