Let's Make Robots!

Propeller Quickstart Buttons

Hey all, I broke down and bought a micro controller finally (aka finally had enough money for one).  I bought the Propeller Quickstart and have been figuring out how to program it in little bits and pieces off of the LEDs on it. There are however 8 "buttons" (actually resistive touch pads) that for the life of me I can't figure out how to use.  I downloaded their demo program that uses the buttons hoping to disect it but I think all the important bits are written in assembly and I have no idea what it means.

So, can anyone help me to either find a place that will walk me through how to do it or put up a bit of simple code that I can dissect to learn how to use these bad boys?  Thanks!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I modifed the QuickStart demo so it writes a one or a zero to an array of eight bytes.  You just check to see it the byte is a one or a zero to see if the pad has been pressed.

I explain how to use the code starting with post #15 of this thread.

Alright, so after some extensive testing and checking with the Parallax Serial Terminal I realized that what I was trying to do initially is in fact what I wanted.

IF ina[0] == 1

outa[16] := 1

That will trigger LED 16 to turn on when pressing the P0 sensor.  The new issue I'm having is that it doesn't want to register it everytime I touch the button.  Maybe it's the calluses on my fingers not making them very conductive or just what I'm not sure but it only registers it every once in a while.

Anyone know a way to make it work more reliably (the demo has it work a LOT better, that's probably why they require a lot more code :) )

It could be that you are having the same problem that mechanical switches suffer from: Bouncing

When you push the button, for you it seems that you only touched it once, but since the microcontroller is faster than you it might think that you have pushed it several times.

The extra code in the demo is probably used to debounce the switch.

I am not too sure how to go about it but somebody here should be able to help you more than meJ