Does the bs2 use BEDMAS in its math?
etc.
Posts: 3
I am building this robot, sort of like a snake but different.
Anyway, i am using the Bs2 to send serial instructions to an SSC-32 servo controller by Lynxmotion, and i was wondering if BEDMAS applied to the stamp's math operations. I have a line of code like this:
the purpose of the code is to send out commands in the following format. # <servo number> p <pulse width of servo> etc. so i am sending out values for 10 different servos. the servos form sort of a chain, and they face opposite directions, so i am inverting the values of every other servo to remedy this. i also need to multiply all the values by 10. it should end up sending a value like this (x represents the value being fed in, y represents the value being sent out to the servo. (300 - x) * 10
so i was pretty much just wondering if BEDMAS applies to the stamp's math operations, and can i use brackets just like in algebra in the stamp?
Thanks
Post Edited (etc.) : 2/1/2009 1:57:12 AM GMT
Anyway, i am using the Bs2 to send serial instructions to an SSC-32 servo controller by Lynxmotion, and i was wondering if BEDMAS applied to the stamp's math operations. I have a line of code like this:
serout 0, 6, [noparse][[/noparse]"#0 p", DEC e0 * 10, #1 p", DEC 300 - e1 * 10, #2 p", DEC e2 * 10, #3 p", DEC 300 - e3 * 10... etc.
the purpose of the code is to send out commands in the following format. # <servo number> p <pulse width of servo> etc. so i am sending out values for 10 different servos. the servos form sort of a chain, and they face opposite directions, so i am inverting the values of every other servo to remedy this. i also need to multiply all the values by 10. it should end up sending a value like this (x represents the value being fed in, y represents the value being sent out to the servo. (300 - x) * 10
so i was pretty much just wondering if BEDMAS applies to the stamp's math operations, and can i use brackets just like in algebra in the stamp?
Thanks
Post Edited (etc.) : 2/1/2009 1:57:12 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Yes, you can use brackets, you even have to sometimes.
regards
adrian
DJ