Giter Site home page Giter Site logo

Comments (37)

rmurphey avatar rmurphey commented on May 12, 2024

FWIW, I was playing with Button just the other day and it was working OK, though I wasn't using the eg/buttonjs code. Took me a couple tries to get the positive and negative and pull-up resistor all wired correctly -- when it wasn't wired correctly, I'd either get an 'up' message when the button was down, or else I'd get no message at all. Can you show your board layout? (Fritzing is a great tool for this.) I'll see about trying out the button example code myself, too.

Also, there's a #robotjs channel on freenode -- it's not johnny-five specific, so I can't promise it will be helpful, but it may be a good place to get real-time help.

from johnny-five.

rmurphey avatar rmurphey commented on May 12, 2024

Confirmed that this is working for me using the eg/button.js example and the corresponding breadboard diagram (though the diagram shows connecting to pin 8, and the example shows connecting to pin 7).

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

@buymeasoda I also just wired up both a pushbutton and a bumper to test this and both work as expected. In addition to @rmurphey's advice, you could also take a picture of your hardware and post the link here.

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

One thing to note, whenever I accidentally wire the pull-up resistor incorrectly, the experience is similar to what you and @rmurphey described: either no signal, or the wrong signal.

from johnny-five.

rmurphey avatar rmurphey commented on May 12, 2024

Here's my setup: http://www.flickr.com/photos/rdmey/7789040686/

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

And mine: https://www.dropbox.com/s/nsejs9px97i5khm/button-wiring.jpg

from johnny-five.

buymeasoda avatar buymeasoda commented on May 12, 2024

Thanks for the info.

Here's my board wiring: http://dl.dropbox.com/u/221145/General/Arduino/button-wiring.jpg

Hopefully the photo is enough to check the setup.

@rwldrn Are you able to talk me through a bit more about the scenario where you "accidentally wire the pull-up resistor incorrectly"? Was that a matter of having the wrong pins in the wrong spot, or something else? Trying to see if I've done what you did when having trouble getting it working :)

Did you have to do anything in between to get it to sort itself out, like reset the board?

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

From this perspective it looks like the resistor is backwards, flip it so the gold band is close to the ground wire

from johnny-five.

rmurphey avatar rmurphey commented on May 12, 2024

I use the resistors in either direction all the time, including on the
board I'm playing with right now, so I doubt that's it :/

On Wed, Aug 15, 2012 at 8:26 PM, Rick Waldron [email protected]:

From this perspective it looks like the resistor is backwards, flip it so
the gold band is close to the ground wire


Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-7773902.

from johnny-five.

buymeasoda avatar buymeasoda commented on May 12, 2024

Yeah, when I first started playing with the kit, I wondered if directionality was a thing, but asked a co-worker who has some electronics background and his take was that it didn't matter for those.

But I'm keen to try anything to get it working, so will have a go switching it about when I'm back home.

It did work with the standard Arduino IDE based script version in this setup though.

from johnny-five.

buymeasoda avatar buymeasoda commented on May 12, 2024

I tried swapping the resister around, and also replacing it with another but no luck.

I've created a gist of the two scripts I've been using to test the button event registering, in case there's something up with my logic for the johnny-five version.

https://gist.github.com/3368911

The first script in the gist, is a standard script compiled and loaded via the Arduino IDE, which works correctly.

The second script is the johnny-five / node script that I'm not able to get working on the same board configuration with standard firmata loaded.

I noticed Rebecca that in your photo, your Uno board is slightly different to mine. I have the one that is the Arduino Uno (SMD Edition), so not sure if that has any compatibility quirks with the firmata or johnny-five? I'll check into that, if these scripts look fine.

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

@buymeasoda I also noticed that you're using the SMD board. Have you tried any of the other Johnny-Five example programs?

Try this:

  1. Disconnect everything from the board.
  2. (optionally) Plugin in an LED to pin 13 and the ground next to it.
  3. Plug the usb into the board and the client machine's usb port.
  4. Walk through uploading StandardFirmata from the IDE
  5. Run the example program: eg/led-strobe.js

Let me know what happens!

Btw, I appreciate your patience with this, it's hard to debug the real world haha. Don't give up hope, we'll figure this out :D

from johnny-five.

buymeasoda avatar buymeasoda commented on May 12, 2024

Cool, I'll give this a whirl when I'm back home again.

I was having fun playing with a tri-color LED last night, using johnny-five (both new five.Led() and new five.Leds()), similar to the docs example at: https://github.com/rwldrn/johnny-five/blob/master/docs/led-rgb.md

And everything worked nicely, so I'm thinking that the test above will pass ok, but I'll run through it to be sure.

Starting to think there might be something to this digitalRead / firmata + SMD version thing. So far it feels like only inputs that are being problematic.

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

Well, I'm glad you're getting somewhere at least. Let me know how everything else goes :)

from johnny-five.

hardbap avatar hardbap commented on May 12, 2024

I'm also having an issue with eg/button.js though I'm not using a SMD board. I checked that I have the button wired up correctly by running Examples > Digtal > Button. I then ran eg/led-strobe.js with no problems.

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

What is the exact issue? No response when pressing the button or incorrect response?

I'm not sure how to figure this out :(

from johnny-five.

paultag avatar paultag commented on May 12, 2024

Can we check how not grounding affects a digital read?

from johnny-five.

hardbap avatar hardbap commented on May 12, 2024

@rwldrn The issue is that there is no response when pressing the button. The firmata.js MIDI[DIGITAL_READ] is not firing at all so this probably isn't a johnny-five issue. Should we bring this talk somewhere else?

from johnny-five.

paultag avatar paultag commented on May 12, 2024

I'm sold that a digital read on a floating line may not read full zero. Try grounding the line. Does it fire?

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

@hardbap that's definitely odd, but an important development none-the-less.

If @paultag's suggestion doesn't work out, maybe @jgautier might have some insight

from johnny-five.

hardbap avatar hardbap commented on May 12, 2024

@paultag I'm sorry but you could please explain how I would go about "grounding the line"? My board is wired up exactly like the pic by @rwldrn except for the two resistors in the bottom left. Does it have something to do with those?

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

@hardbap nope, those resistors are just there from something else, totally unrelated. I was also trying to figure out what @paultag meant, as the diagrams and photos all show a ground line with a resistor

from johnny-five.

jgautier avatar jgautier commented on May 12, 2024

I still have not even hooked up a button to my arduino so I cant really be of much help. I would say to try connecting and disconnecting a wire from the 5v to a pin and see if that makes the event fire. if it does then its probably something with the button wiring if not it might be something with firmata or with the board. let me know if there is anything else i can do to assist with the problem.

from johnny-five.

hardbap avatar hardbap commented on May 12, 2024

Thanks for jumping in @jgautier. I tried connecting a wire from the 5v to a pin and the event did not fire. I also don't see any data coming back from the serial port at all.

So I guess that means it's either the board or firmata. I'm using firmata 2.3 via Arduino 1.0.1. I'll see if I can get my paws on another board.

from johnny-five.

jgautier avatar jgautier commented on May 12, 2024

Interesting some people said they have had issues with firmata 2.3
firmata/firmata.js#8 I was not able to reproduce
the issue though. Can you try downgrading to 2.2 and see if that fixes it?

On Sun, Aug 19, 2012 at 7:57 PM, Mike Breen [email protected]:

Thanks for jumping in @jgautier https://github.com/jgautier. I tried
connecting a wire fro the 5v to a pin and the event did not fire. I also
don't see any data coming back from the serial port at all.

So I guess that means it's either the board or firmata. I'm using firmata
2.3 via Arduino 1.0.1. I'll see if I can get my paws on another board.


Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-7859823.

from johnny-five.

buymeasoda avatar buymeasoda commented on May 12, 2024

Just checking back in with the results of the test @rwldrn asked me to do above.
I ran through the steps and everything's working for for the eg/led-strobe.js script.

I'll have a go at downgrading the firmata.

from johnny-five.

buymeasoda avatar buymeasoda commented on May 12, 2024

@jgautier Just ran a firmata version test, and downgrading to [email protected] (from 0.2.3) fixed the button problem for me.

With 0.2.2, the buttons work as expected, registering presses. Updating back to 0.2.3 caused the issue to return.

from johnny-five.

hardbap avatar hardbap commented on May 12, 2024

I can confirm that 2.2 works for me as well. Thanks everyone!

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

I'm going to update the README to indicate that Firmata 2.2 is the correct version.

from johnny-five.

jgautier avatar jgautier commented on May 12, 2024

Ill try to do some more digging....sucks that 2.3 is not working for some
people. Its working for me though, @rwldrn are you running 2.3?

On Mon, Aug 20, 2012 at 8:54 AM, Rick Waldron [email protected]:

I'm going to update the README to indicate that Firmata 2.2 is the correct
version.


Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-7873843.

from johnny-five.

hardbap avatar hardbap commented on May 12, 2024

I'm not sure if this helps our case but I'm running an Uno R3.

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

@jgautier I'm actually using your pulseIn Firmata, which appears to be 2.3.1

from johnny-five.

jgautier avatar jgautier commented on May 12, 2024

cool Ill do some diffs between the versions and see what changed.
hopefully we can find the culprit.

On Mon, Aug 20, 2012 at 9:10 AM, Rick Waldron [email protected]:

@jgautier https://github.com/jgautier I'm actually using your pulseIn
Firmata, which appears to be 2.3.1


Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-7874362.

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

And I also realized that we're sinking into a dependency quagmire. Development and iteration on Firmata (the cpp protocol lib w/ StandardFirmata) and subsequent releases of the Arduino IDE are not happening fast enough. This feels like an understatement.

from johnny-five.

jgautier avatar jgautier commented on May 12, 2024

I agree it sucks. I submitted the pulseIn to the firmata mailing list and
theres really no movement, im not sure if they are ever going to merge it
in. I saw a post on the arduino mailing list talking about ways to easier
manage libraries, ill look it up and see whatever happend to it. We can
talk about solutions later...I have a few ideas.

On Mon, Aug 20, 2012 at 9:16 AM, Rick Waldron [email protected]:

And I also realized that we're sinking into a dependency quagmire.
Development and iteration on Firmata (the cpp protocol lib w/
StandardFirmata) and subsequent releases of the Arduino IDE are not
happening fast enough. This feels like an understatement.


Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-7874506.

from johnny-five.

rwaldron avatar rwaldron commented on May 12, 2024

I'm open to ideas... even if the idea is...

We support our own repo and node-firmata has a post install hook that replaces /Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata with ours.

... Just a thought.

from johnny-five.

jgautier avatar jgautier commented on May 12, 2024

my idea was to build a plugin to the arduino ide that accesses our github
repo ive already played around with building something like that. or it
could be cool to have a firmata command line tool that you can use to
upload different versions easier.

On Mon, Aug 20, 2012 at 9:30 AM, Rick Waldron [email protected]:

I'm open to ideas... even if the idea is...

We support our own repo and node-firmata has a post install hook that
replaces
/Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata with
ours.

... Just a thought.


Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-7874940.

from johnny-five.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.