basic math question
japer
Posts: 105
trying to get some help with a math problem in stamp programing
1. if i used v = 2 * (8 / 7 ) would this be a proper format in a truth table would. stamp regognize this as =2.1428
or if i wanted this type of return would i have to use some other type of formula to figure in the remainder.
doing an agument like
if ( v < 2 * (c / b )) and (v > (w / r)) then
pulsout ,out , 5500
else
low out
endif
would this mean anything to stamp.
in typing this type stucture in , it has no effect on the result
this where lies my delima, how to use negative numbers in an argument
not looking to answers this formula just looking for the proper format
thank you
l
1. if i used v = 2 * (8 / 7 ) would this be a proper format in a truth table would. stamp regognize this as =2.1428
or if i wanted this type of return would i have to use some other type of formula to figure in the remainder.
doing an agument like
if ( v < 2 * (c / b )) and (v > (w / r)) then
pulsout ,out , 5500
else
low out
endif
would this mean anything to stamp.
in typing this type stucture in , it has no effect on the result
this where lies my delima, how to use negative numbers in an argument
not looking to answers this formula just looking for the proper format
thank you
l
Comments
Are the arguments in your formula (c, b, w, r) actually variables?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
let me give a a better example.
if (v < 2 *( 8 / 6)) and ( v > (9 / 6)) then
jasper
· IF (v < 2.67) AND (v > 1.5) THEN
··· ...
· ENDIF
You could multiply everything by 10 (including "v") and do it like this:
· IF (v < 27) AND (v > 15) THEN
··· ...
· ENDIF
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
hopefully ?
jasper
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
i just realized what you were saying. "no decimal points. " i simply should use the decimal number.
that would give all the tolerance i could posibly need in a 8 bit system
thanks a lot Jon for sticking with my dumb #$% until i got it.
i can simply use the analog voltage reading as UI.
on to the next chapter.
jasper
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
yea just finished it a coulpe weeks ago had to go on vacation so i couldnt get on the next course here,
until last week.
i espeaciallly am proud of my course project in microControler.
it's sad that the project board did nt have a diode in it?
buy pushing different combination of buttons, photoresitor,and Pot sensor inputs, it could:
ramp up in steps ,a small 5 v hardrive fan. you now 25 50 75 100 yea the trick was start at 25 pwm , a quick pop to get
the fan going, then hold fan at 10 count at 100 %
flashing LEDS and rampup's "
my speaker was playing tequila
sevro was trick, photoresistor and combinaton turn pot move that made it change direction,
with the push of a button a light reading was taken and displayed on the led.
trying to make a autoHVAC till i found out the stamp could only do one thing at a time.
but with a 555 timer in this new kit and the programing skills in analog _digita l could make an autoHVAC
just an idea
note:
i especially like the sleep command in your code book.
yea again
over thinging the math "easy"