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 ?.
Help / examples needed.
- 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.
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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.
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.
The program also works well in simulation.
The program also works well in simulation.
Re: Help / examples needed.
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