Code - richar66/FlexSensors-Midterm GitHub Wiki
The code for this project turns on LEDs for particular combinations of bent fingers, more information about this can be found on the Functionality page linked below.
Again, all that was used from the base code was the method of reading in the analog input and printing the voltage to the serial monitor, all else is original.
The code serially reads in the varying voltage of the three flex sensors and accordingly digitally writing out high to turn on the particular LEDs. Below is a link to the Arduino code posted in the file repository. The first part of the code declares the digital pins as outputs and names them with the color of the LED they represent and the analog pins as inputs with names that represent the finger the sensor is on. The code uses if-else statements to determine which fingers are bent and turn the LEDs on accordingly.