I have a 16F877A project that uses a 3 way rotary switch.
Does something like this exist? Can I make one without knowing C?
Or just stick with 3 standard switches and live with it? Not a big problem now that I think about it.
Question 2: It would be very handy for me to be able to Sim a signal multiplexor that will
be used as an input to 1 a/d input (RA0), for 10 different signals.
I realize I should be able to do this via a macro. Before I start, any ideas on the simplest way to do this?
Thanks in advance.
-Craig
16F877A project
Moderator: Benj
- CRAIG CHAMBERLAIN
- Flowcode V4 User
- Posts: 24
- Joined: Mon Jun 27, 2011 6:05 am
- Location: Madison Wisconsin
- Has thanked: 6 times
- 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: 16F877A project
Hello Craig,
1) You can use 3 standard switches in Flowcode to simulate and then use the actual 3-way rotary switch on the hardware. Shouldn't be any problems with doing this.
2) The simplest way to do this would be to read the ADC as a byte, then divide the byte by 26 and finally use the byte as a index for a switch icon with labels 0-9.
1) You can use 3 standard switches in Flowcode to simulate and then use the actual 3-way rotary switch on the hardware. Shouldn't be any problems with doing this.
2) The simplest way to do this would be to read the ADC as a byte, then divide the byte by 26 and finally use the byte as a index for a switch icon with labels 0-9.
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
- CRAIG CHAMBERLAIN
- Flowcode V4 User
- Posts: 24
- Joined: Mon Jun 27, 2011 6:05 am
- Location: Madison Wisconsin
- Has thanked: 6 times
Re: 16F877A project
Ben,
Thanks for the reply.
Not quite sure what you mean by reading the ADC as a byte. Are you saying use the address of the data to select a switch perhaps?
I'm no neophyte, But you left me in the dust on this one!
-Craig
Thanks for the reply.
Not quite sure what you mean by reading the ADC as a byte. Are you saying use the address of the data to select a switch perhaps?
I'm no neophyte, But you left me in the dust on this one!
-Craig
- 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: 16F877A project
Hello Craig,
Please look for the switch case icon in the flowchart icon toolbar. Add one to your program and go into the properties and you will see if needs an input parameter. Use the variable from your ADC read which you have also done the divide by 26 as the parameter for the switch case icon. Valid switch cases will then be 0 - 9 with regards to the ADC voltage.
Please look for the switch case icon in the flowchart icon toolbar. Add one to your program and go into the properties and you will see if needs an input parameter. Use the variable from your ADC read which you have also done the divide by 26 as the parameter for the switch case icon. Valid switch cases will then be 0 - 9 with regards to the ADC voltage.
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
- CRAIG CHAMBERLAIN
- Flowcode V4 User
- Posts: 24
- Joined: Mon Jun 27, 2011 6:05 am
- Location: Madison Wisconsin
- Has thanked: 6 times
Re: 16F877A project
Ben,
I believe you may not understand my goal.
I want to be able to use 4 control lines to control a 1 of 16 analog switch,
which will control which signal is read by the micro. I'll only be using 1 analog input.
It sounds like you are proposing a form of window comparator.
Which does give me an idea for later programming!
-Craig
I believe you may not understand my goal.
I want to be able to use 4 control lines to control a 1 of 16 analog switch,
which will control which signal is read by the micro. I'll only be using 1 analog input.
It sounds like you are proposing a form of window comparator.
Which does give me an idea for later programming!
-Craig