Skip to main content
Tweeted twitter.com/#!/StackArduino/status/549370978338611200
update
Source Link
Pat
  • 13
  • 4

I'd like for a 16x2 LCD monitor from Sparkfun to display sensor data from a 4-directional tilt sensor from Parallax. The Arduino board is a Duemillanove. The board will run and power both programs and modules, but the serial monitor displaying the tilt sensor data will not relay the info to the LCD display. Any suggestions?

Here are the two pieces of code I am trying to get to work together—they are both from Arduino:

For the tilt:

void setup() { 
   Serial.begin(9600); 
} 
void loop() { 
   Serial.print("Photo 1: "); 
   Serial.print(digitalRead(6), DEC); // Display Out 1 value 
   Serial.print("; "); 
   Serial.print("Photo 2: "); 
   Serial.println(digitalRead(7), DEC); // Display Out 2 value 
   delay(250); // Wiat 1/4 second 
}

For the LCD:

#include <SoftwareSerial.h> // Attach the serial display's RX line to digital pin 2 
SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused) 
void setup() { 
  mySerial.begin(9600); // set up serial port for 9600 baud 
  delay(500); // wait for display to boot up 
} 
void loop() { 
  mySerial.write(254); // move cursor to beginning of first line    
  mySerial.write(128); 
  mySerial.write(" "); // clear display 
  mySerial.write(" "); 
  mySerial.write(254); // move cursor to beginning of first line 
  mySerial.write(128); 
  mySerial.write("movement recorded"); 
  while(1); // 
  wait forever 
}

Update:

I'm still tinkering with the suggested program from @Ariser shown below, but keep getting a compile error:

tilt_lcd_ase.cpp: In function ‘void loop()’:
tilt_lcd_ase.cpp:24:43: error: expected ‘)’ before ‘;’ token
tilt_lcd_ase.cpp:25:43: error: expected ‘)’ before ‘;’ token

I've done some research and one person had a similar problem, but it was within #include not void loop. The search continues, but if anyone has a suggestion please chime in. The liquid crystal library is also turning up similar errors but it needs a closer look.

I'd like for a 16x2 LCD monitor from Sparkfun to display sensor data from a 4-directional tilt sensor from Parallax. The Arduino board is a Duemillanove. The board will run and power both programs and modules, but the serial monitor displaying the tilt sensor data will not relay the info to the LCD display. Any suggestions?

Here are the two pieces of code I am trying to get to work together—they are both from Arduino:

For the tilt:

void setup() { 
   Serial.begin(9600); 
} 
void loop() { 
   Serial.print("Photo 1: "); 
   Serial.print(digitalRead(6), DEC); // Display Out 1 value 
   Serial.print("; "); 
   Serial.print("Photo 2: "); 
   Serial.println(digitalRead(7), DEC); // Display Out 2 value 
   delay(250); // Wiat 1/4 second 
}

For the LCD:

#include <SoftwareSerial.h> // Attach the serial display's RX line to digital pin 2 
SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused) 
void setup() { 
  mySerial.begin(9600); // set up serial port for 9600 baud 
  delay(500); // wait for display to boot up 
} 
void loop() { 
  mySerial.write(254); // move cursor to beginning of first line    
  mySerial.write(128); 
  mySerial.write(" "); // clear display 
  mySerial.write(" "); 
  mySerial.write(254); // move cursor to beginning of first line 
  mySerial.write(128); 
  mySerial.write("movement recorded"); 
  while(1); // 
  wait forever 
}

Update:

I'm still tinkering with the suggested program from @Ariser shown below, but keep getting a compile error:

tilt_lcd_ase.cpp: In function ‘void loop()’:
tilt_lcd_ase.cpp:24:43: error: expected ‘)’ before ‘;’ token
tilt_lcd_ase.cpp:25:43: error: expected ‘)’ before ‘;’ token

I've done some research and one person had a similar problem, but it was within #include not void loop. The search continues, but if anyone has a suggestion chime in.

I'd like for a 16x2 LCD monitor from Sparkfun to display sensor data from a 4-directional tilt sensor from Parallax. The Arduino board is a Duemillanove. The board will run and power both programs and modules, but the serial monitor displaying the tilt sensor data will not relay the info to the LCD display. Any suggestions?

Here are the two pieces of code I am trying to get to work together—they are both from Arduino:

For the tilt:

void setup() { 
   Serial.begin(9600); 
} 
void loop() { 
   Serial.print("Photo 1: "); 
   Serial.print(digitalRead(6), DEC); // Display Out 1 value 
   Serial.print("; "); 
   Serial.print("Photo 2: "); 
   Serial.println(digitalRead(7), DEC); // Display Out 2 value 
   delay(250); // Wiat 1/4 second 
}

For the LCD:

#include <SoftwareSerial.h> // Attach the serial display's RX line to digital pin 2 
SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused) 
void setup() { 
  mySerial.begin(9600); // set up serial port for 9600 baud 
  delay(500); // wait for display to boot up 
} 
void loop() { 
  mySerial.write(254); // move cursor to beginning of first line    
  mySerial.write(128); 
  mySerial.write(" "); // clear display 
  mySerial.write(" "); 
  mySerial.write(254); // move cursor to beginning of first line 
  mySerial.write(128); 
  mySerial.write("movement recorded"); 
  while(1); // 
  wait forever 
}

Update:

I'm still tinkering with the suggested program from @Ariser shown below, but keep getting a compile error:

tilt_lcd_ase.cpp: In function ‘void loop()’:
tilt_lcd_ase.cpp:24:43: error: expected ‘)’ before ‘;’ token
tilt_lcd_ase.cpp:25:43: error: expected ‘)’ before ‘;’ token

I've done some research and one person had a similar problem, but it was within #include not void loop. The search continues, but if anyone has a suggestion please chime in. The liquid crystal library is also turning up similar errors but it needs a closer look.

update
Source Link
Pat
  • 13
  • 4

I'd like for a 16x2 LCD monitor from Sparkfun to display sensor data from a 4-directional tilt sensor from Parallax. The Arduino board is a Duemillanove. The board will run and power both programs and modules, but the serial monitor displaying the tilt sensor data will not relay the info to the LCD display. Any suggestions?

Here are the two pieces of code I am trying to get to work together—they are both from Arduino:

For the tilt:

void setup() { 
   Serial.begin(9600); 
} 
void loop() { 
   Serial.print("Photo 1: "); 
   Serial.print(digitalRead(6), DEC); // Display Out 1 value 
   Serial.print("; "); 
   Serial.print("Photo 2: "); 
   Serial.println(digitalRead(7), DEC); // Display Out 2 value 
   delay(250); // Wiat 1/4 second 
}

For the LCD:

#include <SoftwareSerial.h> // Attach the serial display's RX line to digital pin 2 
SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused) 
void setup() { 
  mySerial.begin(9600); // set up serial port for 9600 baud 
  delay(500); // wait for display to boot up 
} 
void loop() { 
  mySerial.write(254); // move cursor to beginning of first line    
  mySerial.write(128); 
  mySerial.write(" "); // clear display 
  mySerial.write(" "); 
  mySerial.write(254); // move cursor to beginning of first line 
  mySerial.write(128); 
  mySerial.write("movement recorded"); 
  while(1); // 
  wait forever 
}

Update:

I'm still tinkering with the suggested program from @Ariser shown below, but keep getting a compile error:

tilt_lcd_ase.cpp: In function ‘void loop()’:
tilt_lcd_ase.cpp:24:43: error: expected ‘)’ before ‘;’ token
tilt_lcd_ase.cpp:25:43: error: expected ‘)’ before ‘;’ token

I've done some research and one person had a similar problem, but it was within #include not void loop. The search continues, but if anyone has a suggestion chime in.

I'd like for a 16x2 LCD monitor from Sparkfun to display sensor data from a 4-directional tilt sensor from Parallax. The Arduino board is a Duemillanove. The board will run and power both programs and modules, but the serial monitor displaying the tilt sensor data will not relay the info to the LCD display. Any suggestions?

Here are the two pieces of code I am trying to get to work together—they are both from Arduino:

For the tilt:

void setup() { 
   Serial.begin(9600); 
} 
void loop() { 
   Serial.print("Photo 1: "); 
   Serial.print(digitalRead(6), DEC); // Display Out 1 value 
   Serial.print("; "); 
   Serial.print("Photo 2: "); 
   Serial.println(digitalRead(7), DEC); // Display Out 2 value 
   delay(250); // Wiat 1/4 second 
}

For the LCD:

#include <SoftwareSerial.h> // Attach the serial display's RX line to digital pin 2 
SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused) 
void setup() { 
  mySerial.begin(9600); // set up serial port for 9600 baud 
  delay(500); // wait for display to boot up 
} 
void loop() { 
  mySerial.write(254); // move cursor to beginning of first line    
  mySerial.write(128); 
  mySerial.write(" "); // clear display 
  mySerial.write(" "); 
  mySerial.write(254); // move cursor to beginning of first line 
  mySerial.write(128); 
  mySerial.write("movement recorded"); 
  while(1); // 
  wait forever 
}

I'd like for a 16x2 LCD monitor from Sparkfun to display sensor data from a 4-directional tilt sensor from Parallax. The Arduino board is a Duemillanove. The board will run and power both programs and modules, but the serial monitor displaying the tilt sensor data will not relay the info to the LCD display. Any suggestions?

Here are the two pieces of code I am trying to get to work together—they are both from Arduino:

For the tilt:

void setup() { 
   Serial.begin(9600); 
} 
void loop() { 
   Serial.print("Photo 1: "); 
   Serial.print(digitalRead(6), DEC); // Display Out 1 value 
   Serial.print("; "); 
   Serial.print("Photo 2: "); 
   Serial.println(digitalRead(7), DEC); // Display Out 2 value 
   delay(250); // Wiat 1/4 second 
}

For the LCD:

#include <SoftwareSerial.h> // Attach the serial display's RX line to digital pin 2 
SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused) 
void setup() { 
  mySerial.begin(9600); // set up serial port for 9600 baud 
  delay(500); // wait for display to boot up 
} 
void loop() { 
  mySerial.write(254); // move cursor to beginning of first line    
  mySerial.write(128); 
  mySerial.write(" "); // clear display 
  mySerial.write(" "); 
  mySerial.write(254); // move cursor to beginning of first line 
  mySerial.write(128); 
  mySerial.write("movement recorded"); 
  while(1); // 
  wait forever 
}

Update:

I'm still tinkering with the suggested program from @Ariser shown below, but keep getting a compile error:

tilt_lcd_ase.cpp: In function ‘void loop()’:
tilt_lcd_ase.cpp:24:43: error: expected ‘)’ before ‘;’ token
tilt_lcd_ase.cpp:25:43: error: expected ‘)’ before ‘;’ token

I've done some research and one person had a similar problem, but it was within #include not void loop. The search continues, but if anyone has a suggestion chime in.

deleted 36 characters in body
Source Link

I am new to hacking electronics. I'd like for a 16x2 LCD monitor from Sparkfun to display sensor data from a 4-directional tilt sensor from Parallax. The Arduino board is a Duemillanove. The board will run and power both programs and modules, but the serial monitor displaying the tilt sensor data will not relay the info to the LCD display. Any suggestions?

Here are the two pieces of code I am trying to get to work together... Theytogether—they are both from Arduino:

For the tilt:

void setup() { 
   Serial.begin(9600); 
} 
void loop() { 
   Serial.print("Photo 1: "); 
   Serial.print(digitalRead(6), DEC); // Display Out 1 value 
   Serial.print("; "); 
   Serial.print("Photo 2: "); 
   Serial.println(digitalRead(7), DEC); // Display Out 2 value 
   delay(250); // Wiat 1/4 second 
}

For the LCD:

#include <SoftwareSerial.h> // Attach the serial display's RX line to digital pin 2 
SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused) 
void setup() { 
  mySerial.begin(9600); // set up serial port for 9600 baud 
  delay(500); // wait for display to boot up 
} 
void loop() { 
  mySerial.write(254); // move cursor to beginning of first line    
  mySerial.write(128); 
  mySerial.write(" "); // clear display 
  mySerial.write(" "); 
  mySerial.write(254); // move cursor to beginning of first line 
  mySerial.write(128); 
  mySerial.write("movement recorded"); 
  while(1); // 
  wait forever 
}

I am new to hacking electronics. I'd like for a 16x2 LCD monitor from Sparkfun to display sensor data from a 4-directional tilt sensor from Parallax. The Arduino board is a Duemillanove. The board will run and power both programs and modules, but the serial monitor displaying the tilt sensor data will not relay the info to the LCD display. Any suggestions?

Here are the two pieces of code I am trying to get to work together... They are both from Arduino:

For the tilt:

void setup() { 
   Serial.begin(9600); 
} 
void loop() { 
   Serial.print("Photo 1: "); 
   Serial.print(digitalRead(6), DEC); // Display Out 1 value 
   Serial.print("; "); 
   Serial.print("Photo 2: "); 
   Serial.println(digitalRead(7), DEC); // Display Out 2 value 
   delay(250); // Wiat 1/4 second 
}

For the LCD:

#include <SoftwareSerial.h> // Attach the serial display's RX line to digital pin 2 
SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused) 
void setup() { 
  mySerial.begin(9600); // set up serial port for 9600 baud 
  delay(500); // wait for display to boot up 
} 
void loop() { 
  mySerial.write(254); // move cursor to beginning of first line    
  mySerial.write(128); 
  mySerial.write(" "); // clear display 
  mySerial.write(" "); 
  mySerial.write(254); // move cursor to beginning of first line 
  mySerial.write(128); 
  mySerial.write("movement recorded"); 
  while(1); // 
  wait forever 
}

I'd like for a 16x2 LCD monitor from Sparkfun to display sensor data from a 4-directional tilt sensor from Parallax. The Arduino board is a Duemillanove. The board will run and power both programs and modules, but the serial monitor displaying the tilt sensor data will not relay the info to the LCD display. Any suggestions?

Here are the two pieces of code I am trying to get to work together—they are both from Arduino:

For the tilt:

void setup() { 
   Serial.begin(9600); 
} 
void loop() { 
   Serial.print("Photo 1: "); 
   Serial.print(digitalRead(6), DEC); // Display Out 1 value 
   Serial.print("; "); 
   Serial.print("Photo 2: "); 
   Serial.println(digitalRead(7), DEC); // Display Out 2 value 
   delay(250); // Wiat 1/4 second 
}

For the LCD:

#include <SoftwareSerial.h> // Attach the serial display's RX line to digital pin 2 
SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused) 
void setup() { 
  mySerial.begin(9600); // set up serial port for 9600 baud 
  delay(500); // wait for display to boot up 
} 
void loop() { 
  mySerial.write(254); // move cursor to beginning of first line    
  mySerial.write(128); 
  mySerial.write(" "); // clear display 
  mySerial.write(" "); 
  mySerial.write(254); // move cursor to beginning of first line 
  mySerial.write(128); 
  mySerial.write("movement recorded"); 
  while(1); // 
  wait forever 
}
moved the code from comment section and reformatted it.
Source Link
Loading
Source Link
Pat
  • 13
  • 4
Loading