Flex Sensor Ranges to RGB LED

Circuit

1 x flex sensor 

1 x resistor for voltage divider circuit (value is half the resistance of the flex sensor)

1 x Microcontroller (LilyPad USB shown)

1 x RGB LED with common ground (cathode)

Code