Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

External buttons - LPT - 25.07.2007

Announcements of new plugins or updates.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Michalki
Posts: 7
Joined: September 2nd, 2007, 6:23 pm

Post by Michalki »

Hi all
I have just made my new LCD with 4 buttons.
When I type $dll(buttons,2,$379,0) in first row and press apply there is just number 32 on screen.
I just need some help and explanation how this plugin works eg: an example of usage will be appreciated.
I noticed that pressin one of buttons hooked to pin 12 or 13 turns backlit of.
Sorry for noobish question but I am new here.

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

To use the buttons, you need to use actions. The buttons plugin simply returns a number which telly you which button was pressed. You can find out what the number is for a particular button by putting the command on a screen and pressing the button - do it for each button you have connected to find out the codes.

Now you can set up an action. Click on the Actions tab at the top of the setup window and you can add actions to do things like "Winamp Play" and "Winamp Next Track".

Each action has a few parts - it's like a simple programming statement: IF (this button pressed) THEN (do this). Each part is put into the appropriate box at the bottom of the Actions window, and then you click Add.

You might have something like:
IF $dll(buttons,2,$379,0) = 32 Then WANextTrack
You have to enter the blue bits in the boxes. and make sure you select the equals sign (=) for this example. You'll have to enter whichever button code you need where I've put 32.

Try a simple action like that to start with (Winamp Next Track, or Next Screen) and then add more actions in the same way. I have actions for controlling Winamp and switching Smartie themes/screens. There's a list of typical actions on the right-hand side of the Actions window.

Does the backlight go off only while you hold the button down, or does it switch off permanently when you press the switch? How is the LCD connected? If it's parallel port, what schematic are you using?

Michalki
Posts: 7
Joined: September 2nd, 2007, 6:23 pm

Post by Michalki »

I use parralel interface connection described on this schematic http://www.realitynet.pl/articles/lcd/schemat_1.jpg. I just added 4 switches connected to pin 10, 11, 12, 13 and to GND.
I think that something is wrong because on screen I see "32" no matter which button is pressed. Even if I don't touch buttons I can see this "32"
As described above backlight turns off just when I press one button when I release it light is on again.
Weird
EDIT 12.09.2007
I doublechecked the circut - looks ok.
I connected display to laptop with build in LPT port still no results - I can only see 32 on display no matter what I do. Only difference is action on pin 10 - pressed button gives backlight off but on screen there is always 32. I got rid of LPT cable (I have DB-25 to DB 25 one) - no result again.
So I opened cable plug and conneted pins from 10 then 11, 12, 13 to GND, 32 remains solid as rock. It seems that plugin does not work for me It can't read the code.
Anybody help please ?

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

Does the backlight go off when you press any button, or does it only go off when the buttons connected to pins 12 or 13 are pressed? It could be a wiring problem, so double-check the connections are going to the correct pins at both ends of the cable, and that nothing is accidentally shorted together.

I think you should be seeing a value of 127 (that's what I get) from the buttons plugin when nothing is connected to the port, so try disconnecting the LCD. If you get a different number, you may have the wrong address in the plugin parameters. What port address do you use in the display settings for your LCD?

EDIT: You edited your post while i was typing a reply...
Did you set up an Action in Smartie to change the backlight when a button is pressed, or does the backlight go off (with no Smartie Actions set) whenever you press a button?

If you have a voltmeter (multimeter), can you test the voltage on the pins with buttons (10-13) when there is no LCD connected, when the LCD is connected, and when you press each button? That might help to discover where the problem is. It might be that you need pull-up resistors on the button pins, like in the big schematic in this thread.

Michalki
Posts: 7
Joined: September 2nd, 2007, 6:23 pm

Post by Michalki »

As for the backlight I didn't set anything it just goes of after pressing button connected to pin 10.
The fact is that I didn't connected resistors and +5 to buttons as in big picture of buttons matrix cause I used first schematic (post no 1).
As for the voltages: pins 10->13 without LCD 0,8V after pressing button voltage drops to 0. LCD connected without running LCD Smartie voltage is 0,2V (screen off), LCD Smartie running - voltage oscilate 0,9 -> 2.7V pressing button voltage drops to 0.
I wil try connection with resistors and 5V line (big schematic)

Michalki
Posts: 7
Joined: September 2nd, 2007, 6:23 pm

Post by Michalki »

Resistors and 5V added as in big schematic - no result still 32 on display without any reaction to pressing buttons (except pin 10 - backlight off)

jmoss1999
Posts: 13
Joined: September 26th, 2007, 3:52 am
Location: Missouri - USA

Post by jmoss1999 »

Just thought I should give props to the author of this plugin, Its a very nice plugin indeed.

wired48
Posts: 1
Joined: November 6th, 2007, 6:45 pm

Post by wired48 »

hi,
i cant find the plugin. cansomeone direct me

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

There's a link to download the plugins just below the 2 circuit diagrams in the first post in this thread.

limbo
Plugin Author
Posts: 1604
Joined: February 13th, 2005, 7:38 pm
Location: Athens - Greece
Contact:

Post by limbo »

mattcro wrote:There's a link to download the plugins just below the 2 circuit diagrams in the first post in this thread.
First of all login to the forums and click here: http://forums.lcdsmartie.org/viewtopic. ... 0736#10736
you will find the plugin at the end of the first post.

liamstears
Posts: 11
Joined: April 20th, 2008, 3:58 am

Re: External buttons - LPT - 25.07.2007

Post by liamstears »

Im currently using pin 15 as a button so i have 5 buttons but i dont have an lcd connected at the moment. If i connect an lcd can I still use pin 15 as a button??

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Re: External buttons - LPT - 25.07.2007

Post by mattcro »

Pin 15 isn't used for the LCD, so you should be fine using it for a button - I'm assuming it's working for you as a button input?

liamstears
Posts: 11
Joined: April 20th, 2008, 3:58 am

Re: External buttons - LPT - 25.07.2007

Post by liamstears »

it was in version 5.3 of lcdsmartie but not now ive upgraded to version 5.4 and using the different command for the buttons. Nevermind 4 buttons will do for me just thinking of a way to output to an led at the moment but wondering if it will work with the usb lcd im getting?

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Re: External buttons - LPT - 25.07.2007

Post by mattcro »

There are several types of USB LCD - what make/model are you getting? Some LCD modules have General Purpose Outputs (GPOs) that can be used to drive LEDs, beepers etc. Your USB LCD might have one or more of these.

If you have a serial port on your motherboard, you can use the same Buttons plugin to turn on/off up to 3 LEDs.

Do you use $dll(buttons,2,$379,0) to get button status with Smartie 5.4? I'd have thought that pin 15 should still work as a button input. Have you got 10k pullup resistors on each button input, like in Szakalit's revised multiplexing schematic in the Buttons thread? If not, try that first. If you need more buttons, try that multiplexing system. You can have up to 16 buttons but you need a load of small diodes, eg 1N4148.

liamstears
Posts: 11
Joined: April 20th, 2008, 3:58 am

Re: External buttons - LPT - 25.07.2007

Post by liamstears »

The lcd im getting is this one: http://cgi.ebay.co.uk/ws/eBayISAPI.dll? ... K:MEWAX:IT

I think if I need more buttons I will use the diode idea and not worry about pin 15 its only 1 button lol

Yes i do use $dll(buttons,2,$379,0) to get button status and no pull up resistors.

Ive tried the serial port led thing but it doesnt work, all 3 pins seem to be on all the time?
Im running windows 7 64-bit, hope someone can help

EDIT::: As im not using my parallel port for an lcd and only using it for buttons can I use the parallel port to output to led's??? I hope someone can help with this as I would love to be able to do this, Thanks in advance!!

liamstears
Posts: 11
Joined: April 20th, 2008, 3:58 am

Re: External buttons - LPT - 25.07.2007

Post by liamstears »

any help anyone???

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Re: External buttons - LPT - 25.07.2007

Post by mattcro »

I guess that LCD will be fine - there's a Smartie driver for the LCD2USB adapter kits.

You can't connect an LCD directly to the parallel port because it isn't designed to output any current (the serial port has stronger outputs). You might be able to get it to work with transistor drivers, but I don't know if the LED plugin can write to the parallel port or not - I've never tried it.

Post Reply