air control wip
This commit is contained in:
parent
7569e573d4
commit
16c89b2908
2 changed files with 33 additions and 1 deletions
Arduino/CanGrow/include
|
@ -35,3 +35,17 @@ GPIO_Index GPIOindex[] = {{ 255, 255 },
|
|||
{ 16, NO_PWM } };
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* CanGrow 12V PCB v0.6 Pin assignment
|
||||
*
|
||||
*
|
||||
* LED - D6 (GPIO 12)
|
||||
* FAN1 - D5 (GPIO 14)
|
||||
* FAN2 - D3 (GPIO 0)
|
||||
* PUMP - D0 (GPIO 16)
|
||||
*
|
||||
* WaterlevelVCC - D7 (GPIO 13)
|
||||
* SoilmoistureVCC - D8 (GPIO 15)
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -164,8 +164,26 @@ void Control_Air() {
|
|||
/* iterate through all configured air devices */
|
||||
for(byte i = 0; i < Max_Outputs; i++) {
|
||||
if(config.grow.air.configured[i] == true) {
|
||||
switch(config.grow.air.controlMode[i]) {
|
||||
/* check if a control Sensor reading is set*/
|
||||
if((config.grow.air.controlSensor[i] < 255) && (config.grow.air.controlRead[i] < 255)) {
|
||||
/* switch for control modes */
|
||||
switch(config.grow.air.controlMode[i]) {
|
||||
|
||||
case CONTROL_AIR_MODE_ONOFF:
|
||||
outputState[i] = Control_Air_Mode_OnOff();
|
||||
break;
|
||||
|
||||
case CONTROL_AIR_MODE_LINEAR:
|
||||
break;
|
||||
|
||||
case CONTROL_AIR_MODE_STEPS:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
/* if there is no control sensor reading selected, just set power */
|
||||
} else {
|
||||
outputState[i] = config.grow.air.power[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue