I building a stair project. As i’m new in programming, I read a lot topics in this forum wich help me to archeive this stae. Unfortunatly, I’m stuck in programming. Below a summary of my project;
I have 12 strips LED WS2812B (one per stair) - One strip, include 22 pixels.
Strips are chained in series - External powered. - I used digital PIN 13 for data.
I’m getting distance form Sharp GP2Y0A710K0F with 100-550 distance range. This one is pin to analog A0.
I’m using Adafruit_Neopixel.h Librairy and SharpIR.h ( for the sensor).
In my loop, I’m mapping the reading distance 100 cm to 380 cm to number of stairs 0 - 12.
getting"distance" from the sensor for a average. The average is means to be draw by the function draw.
Then, i’m trying to move smoothly light stair per stair based on the average of distance reading.
the serial.println (dis) = real distance between object and sensor
the serial.println (i) = stairs (0,1,2,3,…11)
the serial.println (j) = Nbr of pixels from 0 to 264 included in stairs numbers.
The value of variable (i) and (j) seems to be correct but I was excpeted to have my PIX moving but
instead…I got nothing…I spent hours and hours along night to find ans answers to my issue but didin’t find something.
As i said, I never did any program…i’m nearly an amator…but I know there is masters here on programming whom may help me.
In advance Thank you so much.
Code Test.txt (1.79 KB)