Hi all,
I got a few questions about the serial comm on the Arduino. How do you use the serial comm on the pin 0 and 1 of the digital output instead of using the USB? And instead of using the Arduino monitor to display the output, how can I use the hyperterminal instead? Is there any conversion I need to make before display to the hyperterminal?
Here is the simple program that I wanted to test out.
int potPin = 2; // select the input pin for the potentiometer
int ledPin = 13; // select the pin for the LED
int val = 0; // variable to store the value coming from the sensor
void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT
Serial.begin(9600); // use the serial port to send the values back to the computer
}
void loop() {
val = analogRead(potPin); // read the value from the sensor
Serial.println(val); // print the value to the serial port
digitalWrite(ledPin, HIGH); // turn the ledPin on
delay(val); // stop the program for some time
digitalWrite(ledPin, LOW); // turn the ledPin off
delay(val); // stop the program for some time
}