Pages: [1]   Go Down
Author Topic: [Solved] Ascii Table Program  (Read 463 times)
0 Members and 1 Guest are viewing this topic.
Kenosha, WI
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I'm a newbee at Arduino, and I just got my Duemilanove.  I followed the getting started instructions, downloaded the 0012 Alpha software package, got the USB recognized by windows (yea!), found the USB port, told the IDE that I have a Diecimila, uploaded Blink, the light flashed, I then modified the program to give random flashes, it worked also (yea! again).  NEXT, I uploaded the example program Ascii Table, saw the Rx/Tx lights flash and then nothing.  I then added the Blink code to the Ascii Table code and saw a blinking LED, but no Ascii Table.  The blinking stopped as it was supposed to when the number got to 126.  Where is the Ascii Table supposed to show up?  I assume that it is supposed to show up in the IDE below the sketch pad.
Quote

 
// ASCII Table
// by Nicholas Zambetti  

#include "WProgram.h"
void setup();
void loop();
int ledPin = 13;                // LED connected to digital pin 13

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  Serial.begin(4800);
  
  // prints title with ending line break
  Serial.println("ASCII Table ~ Character Map");
 
  // wait for the long string to be sent
  delay(100);
}
 
int number = 33; // first visible character '!' is #33
 
void loop()
{
  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
  
  Serial.print(number, BYTE);    // prints value unaltered, first will be '!'
  
  Serial.print(", dec: ");
  Serial.print(number);          // prints value as string in decimal (base 10)
  // Serial.print(number, DEC);  // this also works
  
  Serial.print(", hex: ");
  Serial.print(number, HEX);     // prints value as string in hexadecimal (base 16)
  
  Serial.print(", oct: ");
  Serial.print(number, OCT);     // prints value as string in octal (base smiley-cool
  
  Serial.print(", bin: ");
  Serial.println(number, BIN);   // prints value as string in binary (base 2)
                                 // also prints ending line break
 
  // if printed last visible character '~' #126 ...
  if(number == 126) {
    // loop forever
    while(true) {
      continue;
    }
  }
 
  number++; // to the next character
  
  delay(100); // allow some time for the Serial data to be sent
}




 
« Last Edit: January 08, 2009, 09:57:44 pm by davidbear1961 » Logged

Norway@Oslo
Offline Offline
Edison Member
*
Karma: 12
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You are correct about the location as of where to expect the ascii/serial. But you'll need to hit the serial monitor button (the rightmost button in the arduino IDE):

« Last Edit: January 08, 2009, 01:20:29 am by AlphaBeta » Logged

Kenosha, WI
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

THANKS! :exclamation
Logged

Pages: [1]   Go Up
Jump to: