Pages: [1]   Go Down
Author Topic: Virtualwire and LCD screen  (Read 743 times)
0 Members and 1 Guest are viewing this topic.
Central UK
Offline Offline
Newbie
*
Karma: 0
Posts: 46
Hard of Thinking
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can anyone help please? Fighting with this all evening!!! >smiley-sad


#1  Using one sketch I'm Happily reading a string of 6 characters from an RF receiver, using the Virtualwire library and outputting to Serial Monitor. (RX port changed to 9 to avoid LCD connector)

#2  Using another Sketch I'm Happily Displaying "hello world" on an LCD screen.

Therefore separately at least my hardware connections appear ok.

When I try to combine #1 and #2......
Not changed any connections from the first 2 tests...

LCD Printing doesn't work.


1) To begin my troubleshooting I stripped out all of the RF code and just printed 123456 on the LCD screen.
That's all it does - all in void Setup (for the test)

Code:
 lcd.clear();
  lcd.print("123456");

123456 appears no problem.

2) Added the VirtualWire libray call and it still printed to screen
Code:
#include <VirtualWire.h>

3) vw_rx_pin(9) and vx_rx_start put back in and still prints
Code:
vw_set_rx_pin(9);        //change the RX pin out of the way of LCD pins
  vw_rx_start(); // Start the receiver PLL running

4) readded the vw_setup(2000) line and the lcd just stays blank???

Code:
vw_setup(2000);          // Bits per sec

Arduino is Duemilanove 328 and I'm working on a prototype shield.

Anyone know why the vw_setup(2000) should prevent me printing to the LCD :-(


Code in order as it sits in the test sketch is..

Code:
 vw_setup(2000);          // Bits per sec
  vw_set_rx_pin(9);        //change the RX pin out of the way of LCD pins
  vw_rx_start(); // Start the receiver PLL running
 
  lcd.clear();
  lcd.print("123456");


If I move the LCD code above the vw code it does print and stay on the screen but I can't change it to something else afterwards.

Any pointers would be much appreciated
Logged

Central UK
Offline Offline
Newbie
*
Karma: 0
Posts: 46
Hard of Thinking
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

WORKING!

This is what I did in the hope that it saves some other newbie from pulling out their hair.

LCD at the receiver end was connected to ports 12 and 11 as per Hello World instructions.

These are the default ports for VirtualWire TX and RX.

Although I was redirecting RX (to port 9) I wasn't changing TX so it was trying to share port 12 with the LCD.

To tidy the cables I just shifted all the LCD connections over to the same block and changed the init line to..
Code:
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

Hey presto a working project.
Logged

Pages: [1]   Go Up
Jump to: