showing the ADC value using LED7Seg4

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
choy
Posts: 15
Joined: Mon Dec 26, 2011 7:59 pm
Has thanked: 5 times

showing the ADC value using LED7Seg4

Post by choy »

Hi all!

I have a school project which I'm in need of help. Basically, I want to show the ADC value using the LED7Seg4. I've no problems showing the ADC value using the LCD component but I can't figure out how to show the ADC (value) using LED7Seg4. Can somebody help? I've been trying to figure this thing out for days, and still haven't found success. Attached is my program config. Help please! I tried Benj's suggestion (http://www.matrixmultimedia.com/mmforum ... 849#p30849) but it didn't work for me.



Thanks!
Attachments
adc-reader.fcf
(8 KiB) Downloaded 235 times

choy
Posts: 15
Joined: Mon Dec 26, 2011 7:59 pm
Has thanked: 5 times

Re: showing the ADC value using LED7Seg4

Post by choy »

hi again!

i've finally figured it out. it's working now and displays the correct ADC value with the LCD as well as the LED7Seg4. things i did:


(assuming adc is 1023)
-created 4 byte variables digit4, digit3, digit2 and digit1.

-for digit1 = adc MOD 10 (which is 3)
-for digit2 = adc/10 MOD 10 (which is 2)
-for digit3 = adc/100 MOD 10 (which is 0)
-for digit4 = adc/1000 MOD 10 (which is 1)

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: showing the ADC value using LED7Seg4

Post by Spanish_dude »

Hi,

Nice you found it yourself.
It wasn't that difficult :mrgreen: .

Nicolas

Post Reply