[McHUG] Playing with Arduino

Rich Mitchell geobra at att.net
Sun Apr 6 18:52:25 EDT 2008


This weekend I was able to load both WinAVR and Arduino 11 on my laptop.  They seemed to run independently of each other.  Both worked properly.  My laptop is an old P3 700MHz ThinkPad running W2K SP4.  For Arduino I simply downloaded the zip file, unzipped it into a folder I made for it and created a shortcut for the exe and moved it to the desk top.  It takes a minute for the Arduino IDE to come up.  

I loaded 2 example programs into the IDE - one at a time.  I first loaded Blink.  For this to work you need a LED with the appropriate resistor (internal or external) plugged into your breadboard attached to the the BareBones Board pin 13 and ground, which conveniently is right next to pin 13.
To load the Blink program, in the Arduino IDE go to:
File --> Sketchbook --> Examples --> Digital --> Blink
That loads it into the IDE workspace.  You can see all the code that had to be written, all 8 lines (plus brackets).  

int ledPin = 13;                // LED connected to digital pin 13

void setup()                    // run once, when the sketch starts
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}

void loop()                     // run over and over again
{
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(1000);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(1000);                  // waits for a second
}

Now compile it by Sketch --> Verify/Compile.  Then load it to the Arduino, which you have hooked to the PC through the serial cable and the P4 adapter, by File --> Upload to I/O Board.  Once it says that it has loaded, press the reset and in ten seconds the LED should start to blink.

The second program I tried was ASCIITable.  This will display an ASCII Table on the PC monitor.  Now this one has 18 lines of code (plus brackets).  Load ASCIITable in the same way as Blink.
File --> Sketchbook --> Examples --> Communications --> ASCIITable
Once you have compiled and uploaded it, start the IDE's serial monitor, which is the rightmost icon at the top.  That will open up at the space at the bottom of your IDE.  Make sure the speed is set to 9600 since that is what the program is running at.  Press the reset button and in ten seconds the ascii table should display in the monitor on the PC.  I was also able to show it with Hyperterm.  This is an easy example because it is using the same serial cable setup that you used to upload the program.

I also loaded WinAVR on the same laptop.  This will run C code if you want to program the BareBones Board that way.  It's a bit more intensive since you will have more setup to do - registers pins ports etc.  This seems to install itself a bit more deeply into the operating system.  Once installed I was able to run the various make commands and modify and load Si570 code into the BBB.

The whole weekend in western MD was not all spent McHUGging.  I took my KX1 and Black Widow Vertical (20' fishing pole) and worked 7 rag chews - 3 on 40m, 3 on 30m and the final one this morning on 20m.  Also got a good start on income tax - Turbo Tax on same laptop.

73,
Rich, N3III

--
McHUG - Physical Computing ;)
MicroController Ham User Group


More information about the McHUG mailing list