Macros and variable options.
Posted: Sun Mar 27, 2016 5:29 am
Hello all,
I am writing a program that has multiple inputs and outputs, I am writing it with macros, to help keep the program structured,
and not a hot mess of a main program.
Hardware is my forte'. I *will* be re-learning C, and mastering FC6 to be able to be able to be a more functional programmer, but for now I have FC6 to get me running.
I am Multiplexing my 16 inputs through a CD4067 16 channel signal mux. I plan on using one macro to get all signal values, and another macro to make the decisions, based
on the values of the inputs that have been assigned variables.
The program attached only shows co2 high and low set point pots, I ran into problems when trying to get a variable assigned to the co2 sensor signal.
My question is, is it possible to write a program with macros using only global variables, without using a bunch of work-arounds, that defeats the purpose of me
trying to keep this simple? I have a current count of 16 total variables.
Will this be too memory intensive, which I understand is the purpose of using locals? Or am I just making to big of a deal of learning how to use local variables in my program?
So far it has been a bit confusing for this Blonde to comprehend the use of locals. Just putting a ".CO2" instead of just "CO2" as a variable has not solved my troubles.
Attached is a start of a test program that shows something of what I am trying to accomplish. If CO2 signal input is above or below the window set by potentiometers,
turn the CO2 supply on or off.
I have been though several tutorials, which have not helped.
If somebody could just show an example of of using locals, if using only globals is not feasible, I would be very appreciative.
I am writing a program that has multiple inputs and outputs, I am writing it with macros, to help keep the program structured,
and not a hot mess of a main program.
Hardware is my forte'. I *will* be re-learning C, and mastering FC6 to be able to be able to be a more functional programmer, but for now I have FC6 to get me running.
I am Multiplexing my 16 inputs through a CD4067 16 channel signal mux. I plan on using one macro to get all signal values, and another macro to make the decisions, based
on the values of the inputs that have been assigned variables.
The program attached only shows co2 high and low set point pots, I ran into problems when trying to get a variable assigned to the co2 sensor signal.
My question is, is it possible to write a program with macros using only global variables, without using a bunch of work-arounds, that defeats the purpose of me
trying to keep this simple? I have a current count of 16 total variables.
Will this be too memory intensive, which I understand is the purpose of using locals? Or am I just making to big of a deal of learning how to use local variables in my program?
So far it has been a bit confusing for this Blonde to comprehend the use of locals. Just putting a ".CO2" instead of just "CO2" as a variable has not solved my troubles.
Attached is a start of a test program that shows something of what I am trying to accomplish. If CO2 signal input is above or below the window set by potentiometers,
turn the CO2 supply on or off.
I have been though several tutorials, which have not helped.
If somebody could just show an example of of using locals, if using only globals is not feasible, I would be very appreciative.