Go Down

Topic: Re: problem with running botton code on processing (Read 415 times) previous topic - next topic

CaptainObvious

Nov 15, 2009, 09:07 am Last Edit: Nov 15, 2009, 09:08 am by thoed Reason: 1
Well what exactly is happening?
Nothing?
Something?

We need to know what's going on to help you debug!

One thing I noticed though.. it says the button is attached to pin 7, but in your sketch it's set to pin 2. Which pin do you have the button connected to?

And do you have a pull-up or pull-down resistor on the button?


Also, did you upload the Standard Firmata example to your Arduino? (that's required for that processing sketch, as it's using Firmata)

beiping

#1
Nov 15, 2009, 07:14 pm Last Edit: Nov 15, 2009, 07:20 pm by beiping Reason: 1
Thank you for replying.  I connected input to pin2, and I did have a pull down resistor, and I tried the code from arduino official website, that one worked pretty well, so I think I use  Firmata in a right way. But my code just does not work at all, it shows nothing on my board, the LED never turn on.  :(

PaulS

Quote
I connected input to pin2


Input from what?

You need to connect +5 to one leg of the switch. The other leg gets connected to pin2 and to one leg of a resistor. The other leg of the resistor gets connected to ground.

CaptainObvious

The official website for the button tutorial is just that, only a button tutorial.

To get the button sketch in processing to work in arduino, you've got to goto Examples, Firmata, Standard Firmata, then upload that..

Then after you do that, run the processing sketch.

Go Up