On Wed, Jan 18, 2017 at 10:43 AM, Dan Roganti <ragooman@gmail.com> wrote:
On Wed, Jan 18, 2017 at 10:07 AM, Evan Koblentz via vcf-midatlantic < vcf-midatlantic@lists.vintagecomputerfederation.org> wrote:
We already tried using a variable. In that example, I built a Lego V-8 style motor. Pressing joystick button 0 one time starts it. I wanted the next button 0 press to stop it. As Dean said, it didn't work using the variable method because of (we think) timing issues. It works fine in walkie-talkie style mode (Dan that's just like the code you and I made ahead of Maker Faire) where "IF NOT BUTTON? 0 [TTO "(port number) OFF] and it also works fine if I have button 1 turn it off. But our attempts to have button 0 turn it on, change a variable to represent that, then check the variable again upon the next button press and turn it off it the variable = 1 just didn't work reliably. The motor stuttered and * sometimes * turned off. Sometimes it worked reliably for a few minutes and then wouldn't work at all.
Another place where I need to check motor status (port on/off status) is for the steering rack. As in a real car, the steering has a mechanical limit. Imagine if you had superhero strength: you could keep turning the steering wheel at its limit and you'd break some component. In the Lego model, if a kid holds the joystick to one side after that limit is reached, then either the Lego pieces start coming apart or the motor could burn out. So I put the optical sensor there. When the sensor is blocked, it turns off the steering rack port. Kind of ingenious right? :) But it doesn't work because the program does not know which master to obey -- the joystick telling it to spin the steering motor or the sensor telling it to stop! I tried some code saying if the sensor is true and the motor is true then turn off the port, but couldn't get that to work. There is chance it was my code at that point, not the logic.
All these problems could be avoided if I had a simple way to check a port status. "Hey I see a button was pressed? Is the port on? Okay, turn it off. Oh was it off? Okay, turn it on."
oh yea I remember that work we did, didn't you see my email this morning at 8:17am, Dean replied that he read it I explained where to look in the manual and it shows you how you can do everything in Basic and Assembly So you can forget using Logo, it just way too limited, for what you are doing and so you can follow the normal programming practices with control system theory, just as the problem you described just now, and as I described in my email this morning, eg, Fault condition when motor stalls by using a better programming language than Logo Dan
oh and since this is really your first foray into robotics, however minuscule it might be, also your attempt to implement and formulate some sort of a control system scheme into your code, when you revisit programming this in Basic and/or Assembly, **highly recommended** You should really consider making a concise Flow Chart. Because it will help you and others that come after you, when you make a museum exhibit from this to explain what is going inside the brain of your robot, however small it might be, it's still a good form of documentation for any project. And these days you can make flowcharts on your desktop instead of pen and paper While including the little details that happen in each step, not just a simple " is the switch On ?" that any dope can write but other pertinent details such as the memory address where that switch is accessed It keeps you from going insane, you don't have enough hair to pull out anymore :) Dan