small medium large xlarge

Back to: All Forums  Arduino
Oppa2_pragsmall
30 Jan 2011, 13:01
Stephan Goldenberg (14 posts)

Hi, thanks for writing this book, I enjoy reading it much.

Now, I have a problem with the binary dice game. Dice is working fine with a single button. I’ve added the ‘guess-button’ and it serves as a 2nd ‘roll-button’. Can anyone explain ? Here is a picture of it: http://foto.arcor-online.net/palb/alben/29/1907129/3766663161363039.jpg I can’t tell what pins get closed when I hit the button, there’s nothing printed on them. And I’m new to breadboards too.

It would be nice to have real schematics though ;)

And a note: I’m running Arduino 0018 on Debian.

randomSeed(analogRead(A0)); is throwing an error

randomSeed(analogRead(0)); is not throwing an error, but does it ‘seed it’ ?

Maik_schmidt_avatar2_pragsmall
30 Jan 2011, 18:08
Maik Schmidt (122 posts)

Hi Stephan!

thanks for writing this book, I enjoy reading it much.

Thank you! I am happy to hear that!

Now, I have a problem with the binary dice game. Dice is working fine with a single button. I’ve added the ‘guess-button’ and it serves as a 2nd ‘roll-button’. Can anyone explain ? Here is a picture of it: http://foto.arcor-online.net/palb/alben/29/1907…

As far as I can see you did not connect the second button to digital pin 5. On the book’s cover and at http://www.flickr.com/photos/50804036@N06/5115096995/in/set-72157625241249772/ you can see how the final circuit should look like. I highly recommend putting the buttons in the middle of the breadboard as shown on the photos, because it gives you a little more space for wiring them.

I can’t tell what pins get closed when I hit the button, there’s nothing printed on them. And I’m new to breadboards too.

Don’t worry! I ran into exact the same problems when I started to work with breadboards and buttons. Regarding the closing pins you might consider reading the following forum entry: http://forums.pragprog.com/forums/129/topics/4615.

It would be nice to have real schematics though ;)

I’ve thought about it but then I decided to focus on the photos, because usually for beginners it’s easier to interpet them.

And a note: I’m running Arduino 0018 on Debian. randomSeed(analogRead(A0)); is throwing an error randomSeed(analogRead(0)); is not throwing an error, but does it ‘seed it’ ?

Beginning with version 19 the Arduino IDE offers constants named A0, … A5 for the analog pins. This explains, why your IDE does not know A0 and using 0 instead is the right solution. Unless you need special libraries that only work with a particular version of the IDE I recommend upgrading to the latest version.

Hope this helps!

Best, Maik

Oppa2_pragsmall
05 Feb 2011, 15:56
Stephan Goldenberg (14 posts)

I got it working ! Now we have prove that size matters, even with mircrocontrollers. :) Bought a bigger breadboard. http://foto.arcor-online.net/palb/alben/29/1907129/3434623033376632.jpg

Have a nice weekend all, Stephan

Maik_schmidt_avatar2_pragsmall
06 Feb 2011, 15:04
Maik Schmidt (122 posts)

Congratulations on finishing this project!!

Keep posting your success stories! They are much appreciated!

Cheers, Maik

You must be logged in to comment