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.
random.c (5.94 KB)
serialrandom.pde (6.91 KB)