Pages: 1 [2]   Go Down
Author Topic: Stepper Moves, IR Flashes, Repeat... How?  (Read 1389 times)
0 Members and 1 Guest are viewing this topic.
United Kingdom
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes Tom, you just need the push switch wired to the input pin (in my code this is set to pin 3 and I call it ButtonPin) and to Gnd (ground or zero volts).

The INPUT_PULLUP causes the pin (pin 3) to normally be set to high via an internal pullup resistor and the reason for this is that it makes it more stable because if you don't do this and you use electric motors then it can spontaneously change with the electronic noise from the motors.

Here's the tutorial about INPUT_PULLUP   http://arduino.cc/en/Tutorial/InputPullupSerial

Cheers

ian
Logged


Kent, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Ian

Sorry for the long delay in replying.  I went abroad for a bit on business and have just been too busy to look at this.  Until today. 

I went over it all again and still could not get it to work.  I stripped everything off the breadboard and started again.  Still nothing.  I then tried using a different pin for the button and using the resistor to pull it down to ground.  This, I'm glad to say, worked.  The whole thing is now working exactly how I wanted.  Thanks for all your help on this

Quick question for fun.  I would like to add something that stops you from pressing the button while it's running.  i.e at the moment if you press it and then press it again, it will reset while running the loop.  Also it might be good to have a cancel button to break out of the loop and reset.

Can I get some clues how to do this?
Logged

United Kingdom
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi again, if you come over to our forum (see my signature for the link) and post your code I'm sure we can help, we have some good Arduino coders.

Please note also that the newest version of BTInterface works slightly differently.

Regards

ian
Logged


Pages: 1 [2]   Go Up
Jump to: