Switches

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
technotim
Posts: 3
Joined: Mon Feb 05, 2007 12:44 pm
Contact:

Switches

Post by technotim »

I am just beginning to learn Flowcode ( V3 pro).

I need to use switches to input a number at startup ( a unit address) This is no problem, however it would be nice to be able to scan the switches using one port bit so that the port could be used for some other purpose later. Is it possible to connect switches not to 0V but to a port bit so that the switches could be scanned and then ignored?

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Post by Steve »

Switches do not expect to have exclusive access to the port bits, so you should be able to connect other items to the port.

Alternatively, ignore the switches component. Instead, at the beginning of your program use an "input" icon and read the value of the port into a variable.

Mark
Posts: 209
Joined: Thu Oct 19, 2006 11:46 am
Location: Bakewell, UK
Has thanked: 20 times
Been thanked: 16 times
Contact:

Post by Mark »

Another aspect of the point you make is that it would be useful to use port pins for two different electrical functions, initial switch input and then for something else later.

One way is to use one port pin as the '5v' or Vcc to the switches (single throw only) by setting as a 'high' output for one switch pole and the other port pins as the input lines for the other switch pole(s).

When the switch has ben read the '5v' outut pin can be made as an input pin so disabling the switches and allowing other uses for the remaining port pins.

Mark
Go with the Flow.

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Post by Steve »

Good idea, Tim/Mark.

The switch component would also benefit from having some other options, such as "normally open/closed" and/or "logic invert". I'll put all of these ideas onto the list.

technotim
Posts: 3
Joined: Mon Feb 05, 2007 12:44 pm
Contact:

Post by technotim »

Mark,

This is exactly what I would want to do as the switches, once set will remain set as the unit will be remote and not accessible, however in simulation I don't think this is possible, is it?

technotim
Posts: 3
Joined: Mon Feb 05, 2007 12:44 pm
Contact:

Post by technotim »

Steve, I look forward to seeing that appear.

Thanks

Tim.

Post Reply