basic analog and digital
japer
Posts: 105
hello
having problems in chapter 3 challenge 4
on led light on at exactly 2 volts, can get it close with truths but not close enough
would it work better as a varible?, definetly lost , any help to nudge me in the
right direction would be great
thank you
having problems in chapter 3 challenge 4
on led light on at exactly 2 volts, can get it close with truths but not close enough
would it work better as a varible?, definetly lost , any help to nudge me in the
right direction would be great
thank you
Comments
·· You should be getting a value back regarding your voltage.· You can use an IF...THEN statement to test for the upper and lower limits to turn on your LED.· It's giving a range, not an absolute value, so you don't have to be exact.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
until 2.67 volts., so decending from 5 volts the voltage will turn on at
2.67 volt value, so as far as the challange goes this would be a failure.
maybe some extreme math that i havent though of yet ?
thank you for responding.
i will try to narrow this comand using the decimal number and may try the binary number
but no success with the binary number at all so far.
this code will seem to be very important later, when exact position will be desireable
thanks again
will burn through this subroutine all day sunday.
·· Just re-read a little of the preceeding section and keep cracking at it.· You may realize it was easier than you thought afterward.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
" probably overthinking the problem,hey if i was a smoker, a smoke break
would do the trick.
if (adcBits = 102 ) then 'adcBits 102 = 2.00 Volts
High out
else
LOW out
ENDIF
RETURN
this will turn light as per challange #4 at Exactly 2.00 Volts, But..... the tolerance are so tight that
a subroutine will have to be added if movement was to fast on POT
··· That's why you use a command like:
lighton:
if (adcBits·< 103 ) and (adcBits > 99) then
High out
else
LOW out
ENDIF
RETURN
This gives you a little breathing room.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
i see you used 2 aguments instead 3 which i was using
still.... having problem trying to tight up the tolerance. using voltage so as it goes its a shallow victory.
·· That's just a clue of how to get it within a range.· There are a few other ways to do the same thing, which are more verbose, or less verbose, but I chose one I thought would be easy to understand.· Anyway, I hope that gets you on the right track.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com