Help / examples needed.

Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

Post Reply
canielsen
Posts: 6
Joined: Sat Oct 17, 2009 10:35 pm
Contact:

Help / examples needed.

Post by canielsen »

Hi
IΒ΄m newbie, and iΒ΄m trying to make a program with 4 switches and a LCD, but im need some help.
The program should works like this:
When one of the 4 switches a are pressed, there should be a message on the display, that mentioned which of the switches were pressed, and and output pin on a port should go high, until another switch are pressed.
When another switch are pressed, another output pin on the port should be activated, and the display should now indicate which switch were pressed.

I am trying to make a circuit, where i can switch between 4 outputs, by pressing the accoiated switch, and the display should indicate - which output are activated.

IΒ΄ll hope you understand what i mean.

I can not find any example that can help me to make this program.
IΒ΄m using Flowcode 3 pro (purchased from ELEKTOR) and a 16F877A.

Can anyone help me with a example ?.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Help / examples needed.

Post by Benj »

Hello

Ok it sounds like you need to do something like this inside a while 1 loop.

Use an input icon to read a single input pin.

Using a decision icon see if the input pin is a logic 1.

If it is then send the appropriate text to the LCD and set the appropriate output also clear all other outputs.

Repeat for other switches.

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: Help / examples needed.

Post by Sean »

Here is a program that hopefully demonstrates the features you need. It is set up for inputs on Port D 0 - 3 and outputs on Port C 0 - 3. These are easy to change if they do not match your application. The LCD is on Port B - default connections.
Switch2LCD.fcf
(8 KiB) Downloaded 324 times
The program also works well in simulation.

canielsen
Posts: 6
Joined: Sat Oct 17, 2009 10:35 pm
Contact:

Re: Help / examples needed.

Post by canielsen »

Thank you very much for your help. This was just what i needed. Now i can see what i have done wrong. I had forgotten to make the loop :oops:

Post Reply