Go Down

Topic: From PC Console programming to Arduino Programming. (Read 2084 times) previous topic - next topic


Oct 25, 2011, 11:30 pm Last Edit: Oct 25, 2011, 11:35 pm by Jorh Reason: 1
From PC Console programming to Arduino Programming. Also known as just about the silliest thing you can do with an Arduino: Exactly the same thing you would do on a PC console/terminal.

We're gonna play the Randomized Number Guessing Game!

Anyways, just recently, I got my first Arduino! I've been wanting one or at least reading about Arduino for a couple years now. I'm a college student living with my parents. I finally got a job so that I can be not broke. Anyways, I still haven't gotten my first paycheck, but I had some Amazon "Gift Points" I got from selling off one of my textbooks. So I got me an Arduino UNO. However, I don't have any hardware, not even LEDs. But I do have extensive programming experience.

So, I did the obvious (only?) thing I can do at the moment. To get myself acquainted with the nuances of Arduino programming, I wrote a command line program that runs over serial. I then ported the game over to plain C to test my two characters to byte routine (I caught some other bugs before I had to debug on the arduino). Then I realized this might be helpful to other people who are relatively novice at Arduino programming, but have a basic understanding of general programming.

Sources are attached. The ".pde" is the sketch. The ".c" is the normal PC program.

Also, as a warning, the guessing game asks you to input a number from 0-255 in hexadecimal. There's a short Hexadecimal tutorial in each of the sources.


Hi, Cool idea and a good example...

For beginning the Hardware Trek, this may be helpful: http://arduino-info.wikispaces.com/GettingStarted-Software

Connections: http://arduino-info.wikispaces.com/Cables

Few tutorials: http://arduino-info.wikispaces.com/TUTORIALS

Have fun, and the good people here can help with questions....
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info


Cool. Yourduino.com has tons of reasonbly priced components and kits. This is definitely bookmarked. Thanks for showing it to me.

Udo Klein

Have a look at my blinkenlight project http://www.blinkenlight.net. The experiments range from trivial to advanced :)
Check out my experiments http://blog.blinkenlight.net

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131