BS2SX Storing Input Data?
beazleybub
Posts: 102
I'm not sure·how to exactly ask this but here it goes.
Let's say I have two push buttons "Button A" and "Button B" and I push "Button A" ten times and then walk away from the bs2sx for a snack break for several minutes.
Later I come back and press "Button B" and in return the bs2sx flashes an LED as many times as I had pushed the button "ten flashes".
How hard is this to accomplish?
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
What if there was nothing? Nothing is something!
Let's say I have two push buttons "Button A" and "Button B" and I push "Button A" ten times and then walk away from the bs2sx for a snack break for several minutes.
Later I come back and press "Button B" and in return the bs2sx flashes an LED as many times as I had pushed the button "ten flashes".
How hard is this to accomplish?
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
What if there was nothing? Nothing is something!
Comments
You can achieve what you ask·with any & all Basic Stamps, down to the simplest BS-1. In fact, it sounds like this is all new to you, and may I humbly suggest that you consider using a BS-1 Project Board. At $15, it's the best deal going. It has a prototyping area to plug into, a 9-volt connector, serial cable connector, and 8 I/O pins, each lovingly protected by·its own·220-ohm resistor. Nothing not to love about that deal. It's ALMOST indestructable and a fantastic place to start. I teach·classes in programming them, I use them in projects at work, I've built contest-winning robots with them. Very useful and flexible.
But if you already have a BS2-SX and a carrier board, you're on your way. No matter which chip you choose, monitoring & counting button presses and blinking LEDs are the most basic·things to learn and program.·You need two pushbuttons, an LED, and some resistors. Get or download the What's a Microcontroller book, and you'll be programming in no time.
You could ask someone here exactly how to·do it, but you'll learn more going through the book. The author Andy Lindsay is a wonderful tech writer, and all-around great guy!
Do the right thing, beazleybub!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
The problem I face is that between juggling 50+ hours at my night shift job and having a family to take care of I have a devil of a time finding the time to study and retain what I read in my book.
I am more a hands on kind of guy and it is easier for me to learn by example. I really wish I had more time to study my book. I really find myself getting interrupted constantly because of my family life and never seem to be able to retain what I have practiced!
If you would be so kind to point out what chapter(s) in my book might help me out with this I would really appreciate it.
What I actually plan to do is incorporate this new idea into my existing bs2sx relay board as a revision.
Thanks again, Beazleybub
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
What if there was nothing? Nothing is something!
Depending on your pushbutton type, you might get some noise or·bounce when you press it, so you'll have to deal with that using the BUTTON command or a simple timing loop that limits how fast you look for keypresses. If you have the Stampworks book, Experiment #15 shows·one way·to debounce multiple switches. You could also add a small capacitor (.1 to 1 uF) across each switch to filter the signal.
Software-wise, you'll need two loops: one to count the button presses·and one to flash the LED. I'm an old-school fan of·FOR-NEXT loops for these counting loops. But I digress. Hook up your switches & LEDs and work through that WAM example. Let us know how you do!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Thanks for your input. Unfortuneately I do not have the stampworks book. Can I download it from Parallax?
Also Will I be Using Read / Write Commands in this project?
You have given me some good ground to stand on and I will let you know how things turn out.
Thank you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
What if there was nothing? Nothing is something!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
www.parallax.com/Store/Books/BASICStamp/tabid/168/List/1/ProductID/144/Default.aspx?SortField=ProductName%2CProductName
Warmest regards to you and yours.
And Larry, I love your avatar!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
What if there was nothing? Nothing is something!