Pseudo-Medical Monitor Code CONFIGURATION STUFF: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<nowiki> | <nowiki> | ||
== | |||
void ConfigurationScans() | |||
{ | |||
int configuration_select = 0; | |||
bool refresh_screen = true; | |||
int encoder_A = 0; | |||
int encoder_B = 0; | |||
while(configuration_select != -1) | |||
{ | |||
switch(configuration_select) | |||
{ | |||
case 0: | |||
if (refresh_screen) | |||
{ | |||
ConfigurationMainUnit(); | |||
Controls.reset_All(); | |||
} | |||
refresh_screen = false; | |||
break; | |||
case 1: | |||
if (refresh_screen) | |||
ConfigurationPort(0); | |||
refresh_screen = false; | |||
break; | |||
case 2: | |||
if (refresh_screen) | |||
ConfigurationPort(1); | |||
refresh_screen = false; | |||
break; | |||
case 3: | |||
if (refresh_screen) | |||
ConfigurationPort(2); | |||
refresh_screen = false; | |||
break; | |||
case 4: | |||
if (refresh_screen) | |||
ConfigurationPort(3); | |||
refresh_screen = false; | |||
break; | |||
} | |||
if (Controls.pcf_event) | |||
{ | |||
encoder_A = Controls.encoder_A_Dir(); | |||
encoder_B = Controls.encoder_B_Dir(); | |||
if (encoder_B 1) | |||
{ | |||
if (configuration_select < 4) | |||
++configuration_select; | |||
refresh_screen = true; | |||
} | |||
if (encoder_B -1) | |||
{ | |||
if (configuration_select > 0) | |||
--configuration_select; | |||
refresh_screen = true; | |||
} | |||
if (Controls.encoder_A_Switch() 1) | |||
{ | |||
configuration_select = -1; | |||
} | |||
Controls.pcf_event = false; // Cleans the interrupt status | |||
delay(20); | |||
} | |||
} | |||
} | |||
</nowiki> | </nowiki> | ||
[[Pseudo-Medical_Monitor_Code#Custom_Includes]] | [[Pseudo-Medical_Monitor_Code#Custom_Includes]] | ||
Revision as of 19:42, 11 December 2021
void ConfigurationScans()
{
int configuration_select = 0;
bool refresh_screen = true;
int encoder_A = 0;
int encoder_B = 0;
while(configuration_select != -1)
{
switch(configuration_select)
{
case 0:
if (refresh_screen)
{
ConfigurationMainUnit();
Controls.reset_All();
}
refresh_screen = false;
break;
case 1:
if (refresh_screen)
ConfigurationPort(0);
refresh_screen = false;
break;
case 2:
if (refresh_screen)
ConfigurationPort(1);
refresh_screen = false;
break;
case 3:
if (refresh_screen)
ConfigurationPort(2);
refresh_screen = false;
break;
case 4:
if (refresh_screen)
ConfigurationPort(3);
refresh_screen = false;
break;
}
if (Controls.pcf_event)
{
encoder_A = Controls.encoder_A_Dir();
encoder_B = Controls.encoder_B_Dir();
if (encoder_B 1)
{
if (configuration_select < 4)
++configuration_select;
refresh_screen = true;
}
if (encoder_B -1)
{
if (configuration_select > 0)
--configuration_select;
refresh_screen = true;
}
if (Controls.encoder_A_Switch() 1)
{
configuration_select = -1;
}
Controls.pcf_event = false; // Cleans the interrupt status
delay(20);
}
}
}