Inverting Outputs
Gary D.
Posts: 37
Ok simple question....
Given the following with a BS2
code var byte
code = 8
OUTH = code
the output of pins 8 through 15 would read
00001000
Is there a way in pbasic to invert this output?
code = 8
OUTH = code
11110111··· is the output i need.
or will i have to use·an inverter.
Thanks for all response...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 kinds of people....
Those who know binary and those who Don't.
Given the following with a BS2
code var byte
code = 8
OUTH = code
the output of pins 8 through 15 would read
00001000
Is there a way in pbasic to invert this output?
code = 8
OUTH = code
11110111··· is the output i need.
or will i have to use·an inverter.
Thanks for all response...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 kinds of people....
Those who know binary and those who Don't.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Basically what i am trying to do is start at 11111111 and finally get down to 00000000
so therefore (without the loops)
code = 255
code = code - 1
OUTH = code
I new there was a simple way... Thanks Guys for letting me see the light
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 kinds of people....
Those who know binary and those who Don't.
· FOR OUTH = 255 TO 0
··· PAUSE 1000
· NEXT
Remember that OUTH is a variable just like any other, except that it connects its bits to the outside world (P8..P15 in this case).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I didnt know that OUTH was a variable...
Its kind of hard when my Help File is frozen... LOL.
thanks Again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 kinds of people....
Those who know binary and those who Don't.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
That happened to me so many times with my Windows 98SE system, that I gave up trying to use the Help File from within the Stamp Editor. I just keep a shortcut to PBASIC.CFM right next to the Stamp Editor icon, and invoke it outside the Stamp Editor. It hasn't failed once since then.
I suspect it has to do with running a low memory resource machine as I do, but I may be mistaken in that assessment. It's never failed (from within the Stamp Editor) with my Windows XP machine, which has 3 X the main memory (by necessity <sigh>) as my Windows 98SE machine. Often even the Stamp Editor will crash on my Windows 98SE machne, if I have more than two copies of Windows Internet Explorer active at one time (even though they're minimized). Admittedly, there are other things running concurrently as well. None of the other program or applications I run are so affected, however.
Regards,
Bruce Bates
Its been a while since i have read That book...
I like to skip a lot of stuff... i would really like to get into servo control... thats the only thing that baffles me...
Pulse width modulation is a kicker...
i have had two of my designs go to the patent office both of them utilizing One or more BS2 processors....
Yet when i was earning my BSEE i wish i could have had your job... you truly have the job everyone wants... What a better way
to make a living than to play with Parallax products all day. i have spoken to you over the years before i doubt you remember
me at all. I am just another Vastly growing BS2 Hobbiest since 1998.
Thanks always for your Help Jon.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 kinds of people....
Those who know binary and those who Don't.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Now, to control this, all you have to do is use the PULSOUT command to send the pulse-width signal, and repeat that every 20 mS to 50 mS. A 1.0 mS pulse will move far left, a 2.0 mS pulse will move far right, and a 1.5 mSec pulse will center the servo.
Now, it is possible to "modify the servo", and disconnect the variable resistor from the gear train. You set the variable resistor to the center of its motion, and clip any limits from the gears so they can rotate continuously. Now your 1.0 mSec makes the servo rotate continuously one way, 2.0 mSec the other, and 1.5 mSec makes it stop. But you lose the 'absolute' positioning capability when you 'modify' a servo this way.
Thanks Very much for the info Allan, i cant wait to start.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 kinds of people....
Those who know binary and those who Don't.