PDA

View Full Version : Link2FS In out display switch issue



John UK
12-21-2012, 11:16 AM
I have recently set up a small LCD screen to run the pde_inout_v2 sketch.

Everything worked as it said it would in the instructions, so that was good and it spurred me on to think on how I could improve it.

The potentiometer that I have has the standard three pins plus another 4 on the rear of the device. There is a switch in the device as well as the potentiometer function, so the switch is like a on/off volume switch in a radio. It appears that these extra terminals provide a double pole switch. What I am trying to do is to use the potentiometer as a contrast control and as an off/on switch as well.

I have run into a problem. I wired the potentiometer as follows:

The centre wire is wired as in Jims diagram for the pde_inout_v2 sketch. The ground and 5v wires pass through the double pole switch before the potentiometer. All other wiring is as in Jims diagram

The result is that when switched on before the power goes to the board all is well and the display shows the message 'Hi_from_Jim_:)_' and underneath 'Waiting_for_data'. The contrast works and the display can be switched off. When the display is switched on again the message is not there, the display shows a full set of black dots (16 rectangles) on the top line and none on the second line. The same display is shown if the potentiometer is in the off position and turned on after the board is initialized, I don't get the Hi_from... message at all.

I thought this may be as the Hi message is output at the start of the code and not in the looping section, so i copied it to the loop. No difference. I think it must be something else I am doing but I cant think what it is. Its probably something basic I have misunderstood but I cant think what. The good news is that the contrast function seems to work ok whatever I do.

The display is HD44780-compatible. The only way I can regain the message is to disconnect and reconnect the USB lead. The display is USB powered.

Any help would be great!

zulucat
12-21-2012, 01:26 PM
Why are you turning the display on & off? Are you trying to conserve power?


The result is that when switched on before the power goes to the board all is well and the display shows the message 'Hi_from_Jim__' and underneath 'Waiting_for_data'. The contrast works and the display can be switched off. When the display is switched on again the message is not there,

That's because the display data is stored in the HD44780. Loss of power, loss of data.


I thought this may be as the Hi message is output at the start of the code and not in the looping section, so i copied it to the loop.

The HD44780 needs to be initialized after power on. It's done when you execute the statement:

LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

The only way that will happen is to reset the Arduino (with power applied to the LCD) or cycle the power (as you are doing).

If you are not trying to save power you can use "lcd.noDisplay()" and "lcd.display()" to turn the display off and on.

Doug -

John UK
12-21-2012, 01:41 PM
If you are not trying to save power you can use "lcd.noDisplay()" and "lcd.display()" to turn the display off and on.

Doug -

I don't want the display on for all the aircraft types I fly, (i am building a generic cockpit). But thanks for this tip Doug, I can probably use the switch on the potentiometer to toggle these commands as it can be used independently of the contrast adjustment.

John UK
12-21-2012, 02:42 PM
I don't want the display on for all the aircraft types I fly, (i am building a generic cockpit). But thanks for this tip Doug, I can probably use the switch on the potentiometer to toggle these commands as it can be used independently of the contrast adjustment.

Ok I tried this and it didn't do what I wanted. It blanked the display but the display was still back lit. I want the screen to turn off. I suppose that means I do want to save power, although that is not the primary reason for what I want.

iwik
12-21-2012, 04:41 PM
Hi John,
You said the switch on the pot was a double pole, use the other pole to switch Backlite supply.
Les