Teacher in need of help with a project

Hello all, I've decided to do a project that on the surface I thought would be very simple but I'm actually fairly stuck.

The project is for eye-movement tracking but the code seems to have me totally stumped.

The goal was to have a strip of WS8212b LEDs connected to an Arduino and a pot. When the pot is turned it relates directly to the strip so as you turn it an led lights up and the previous led turns off.

If you turn it quickly the led moves quickly down the line, if you turn it back it the little led will come back down the strip matching the speed.

I'm not really sure what terms to look for or how to even start this, I have fairly basic Arduino skills. Could someone help or point me in the right direction? I've tried the FastLed library but none of the examples helped me understand how to do the code myself

Thank you

Turn off the current LED
Read the pot value using analogRead()
Use the map() function to convert the pot value, which will be between 0 and 1023 into the range 0 to the number of LEDs
Use the result of the map() to turn on the corresponding LED

would you know of any videos or tutorials that have gone through a similar process to that I can see how they did it?

The pot will have a range of 0ish to 5ish V's on a Uno. That's 1024 steps from the A to D converter.

How many LED's?

You'd want to relate the LED light ups to the A:D readings.

Lets say you have 1024 lights. That would be 1 LED per step from the A:D. If you did 512 LED's that would be 2 steps of A:D value per LED and so on and so forth down the line.

A relationship between the voltage being read by the A:D converter and the number of LED's.

How many LED's?

Sorry, no

Which part are you stuck on ?
Which LED library do you intend to use ? FastLED would be good choice

the number of LEDs will probably be the maximum that would run smoothly without any extra components so 1024 leds would be ideal for me

honestly just all of it. I'm not really sure where to start. My previous experience with Arduino is very basic LEDs and servos for primary school projects.

I don't want to seem like one of those who want others to do it for me, I just don't know where to even begin

Did you do the project where the pot was turned and the servo turned as the pot turned?

How will you be powering the LEDs ?

yes! I know that one

Start with the FastLED examples

1024 LED's would require a very large power supply. Even with a 100 or even 20 or 10 LED's on a strip will require an extra power source.

probably a small 9v battery as only one led will be running at a time or a 2 series18650 pack

Don't expect it to last long

My understandine is the control message for each LED is concatenated to make a longer data stream.
So if you have 6 LEDs to control the messate is something like:

0 0 0 0 0 0 = all LED's off
0 1 0 0 0 0 = 2nd LED on others off.

However each of the above digits are really 24 bits of information. Read this for explanation of the protocol.

I would guess the 24 bit command for each LED will have two values (if the same color and brightness is used).

  1. ON
  2. OFF

So you would read the pot position using an analog input.
Determine which LED should be ON.

In a for loop that loops as many times as there are LED's
for each LED send out a OFF command but when you come the the LED you want to have ON (identified by an if statement) you stick in one ON command.

If you have done that project then you have a good start.

Can you please confirm the type of LEDs that you intend to use ?

Ok so i understand how I will go about mapping which led will be turned so now I'll need to find how to call out the specific led to come on and turn off all others and that should be the whole project unless I'm over simplifying it in my head again

As I suggested, check the FastLED library examples such as Blink

What do you teach ?