i need help in a code for sequencing a set of led's musing potentiometer....code should be such that when the potentiometer is in the range of 0-250 then there is a led sequence and when the potentiometer is in range of 250-500 then there should be another sequence of led's ..and for rest of potentiometer range there should be another code.......please use 4 led's
OK so what is this for, It sounds like a school project.
But what you need to be doing is taking the input from the pot that i will assume is wired across the 5v voltage of the arduino and Gnd with its wiper connection going to A0.
Next you need to map the incoming value from the ADC 0-1024 to 0-1000.
Then set up a series of "if/ else if" statements to capture the range of values that you are interested in. Then for each condition run a function to either sequence the LEDs or do what ever else it is that you are wanting to do.. If you need the functions to be non blocking then a little more work is required.
Cheers Pete.