My potentiometer in a adc led counter doesnt work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-02-24 07:05 PM
Im trying to do an ADC led counter, but when i debug my program i see the live expression and i can watch the changes in the potentiometer, but D10,D9,D8 AND D7 are on but with 1.8v, and d5,d4,d3,d2 turn on with 3.3v, the main idea is that when i rotate the potentiometer the leds will turn on one by one, what u think about this, what can i change.
Potentiometer in ADC_0 and 8 leds, each with a resistence of 1k, im using a PORTD; using D10, D9, D8, D7. D5, D4, D3, D2.
- Labels:
-
ADC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-02-24 11:23 PM
> ... and 8 leds, each with a resistence of 1k, ...
There are different kinds of LEDs, with different threshold voltages and current requirements.
Check that your schematic is appropriate, and does not overload the GPIOs.
> ...the main idea is that when i rotate the potentiometer the leds will turn on one by one, what u think about this, ...
You would need to implement this in your code.
Partition the ADC voltage in an appropriate number of ranges, and turn the next LED on once the respective level is reached - or off if it falls below.