kennyburns
New Member
hey i have a small project that i need to finish and im having hard time with the c programming.
i have a pic16f877 and need to read a value from a pot that will give 7 set values then i have to convert the analogue signal fromt he pot into digital and display on a 7 segment LED display A number from 0-6
i will have to use the 10 bit adc for me to be able to seperate the voltages into the groups i want
so we have 0-5 volts and 0-1023 steps
so the program would have to group the numbers like this:
no== voltage== no adc=======binary
--------------------------------------------------------------
1 == 0.06v== 0 =< >=13------
2 == 0.08v== 14=< >=17
3 == 0.10v== 18=< >=21
4 == 0.13v== 22=< >=27
5 == 0.16v== 28=< >=33
6 == 0.17v== 34=< >=36
0 == 4.97v== 37=< >=1023
the analogue input will go on the RA0/AN0 pin no 2
the 7 seg LED will be driven by RB0 - RB7 or port B pins from 33-40
ground would be connected to VDD or pin 11
and +5v to vss or pin 12
could a kind soul that i will be forever greatfull to, give me some help because im starting to loose my mind with c programming
:/
i have a pic16f877 and need to read a value from a pot that will give 7 set values then i have to convert the analogue signal fromt he pot into digital and display on a 7 segment LED display A number from 0-6
i will have to use the 10 bit adc for me to be able to seperate the voltages into the groups i want
so we have 0-5 volts and 0-1023 steps
so the program would have to group the numbers like this:
no== voltage== no adc=======binary
--------------------------------------------------------------
1 == 0.06v== 0 =< >=13------
2 == 0.08v== 14=< >=17
3 == 0.10v== 18=< >=21
4 == 0.13v== 22=< >=27
5 == 0.16v== 28=< >=33
6 == 0.17v== 34=< >=36
0 == 4.97v== 37=< >=1023
the analogue input will go on the RA0/AN0 pin no 2
the 7 seg LED will be driven by RB0 - RB7 or port B pins from 33-40
ground would be connected to VDD or pin 11
and +5v to vss or pin 12
could a kind soul that i will be forever greatfull to, give me some help because im starting to loose my mind with c programming
:/