80Views4Replies

Author Options:

Arduino Leonardo with Flex Sensors Answered

I am trying to build a flex sensor gloves that acts as the input and translate the bend of the flex sensors into output in the PC. But it seems i cant get the coding right. I am using the Arduino Leonardo as my microprocessor. Creating atleast 3 input which operate the right, left and up button to be used in a basic car game. Anyone can help me constructing this project? Thankyou. Appreciated.

Discussions

None
caitlinsdadcaitlinsdad

Reply 3 years ago

oh, and look up ibles or arduino.cc to use the arduino for HID output to mimic keyboard/mouse instructions so that the glove can trigger and output to your game on the PC to receive what it thinks are keypresses. Good luck.

None
AzrilAcaitlinsdad

Reply 3 years ago

thank you. but the Arduino Leonardo already acts as a keyboard input. do i still need to HID output to mimic keyboard instructions? i am a beginner. sorry. :)

None
caitlinsdadAzrilA

Reply 3 years ago

You've got a couple of things to get working and then put it all together. Look up arduino USB keyboard hacks. Get your flex switches(homemade or store bought) working to see if they trigger an LED or print something to the serial monitor. With the HID library, you can mod your sketch to have the different values of the force sensor mapped to output the ascii keycode for left, right, etc.(without using a bunch of IF loops - use the CASE statement structure)