Hi. I am trying to dim multiple LED's using one potentiometer. I am first completing this in TinkerCad. I am able to turn the LED's on and off, but I seem to be missing something as far as controlling the amount of electricity is going to the LED's to control how bright it is. I am trying to keep the code simple, but any advice would be helpful. I am trying to not use the map function.
You are reding the pot then ignoring the value that you have read
when you read the pot into an int variable you will get a value between 0 and 1023. To control the brightness of the LEDs they must be connected to PWM pins and you must write a value between 0 and 255 using analogWrite().
To avoid the use of the map() function (why ?) just divide the value read from the pot by 4 and write it to the LEDs
Thank you for the feedback. I wasn’t sure if the map function was need, but it appears that the map function must be included for the voltage divider and the analogWrite with the PWM pins. I appreciate the help.