int _ABVAR_1_voltage = 0 ;
int _ABVAR_2_fan = 0 ;
void setup()
{
pinMode( 5, OUTPUT);
pinMode( 6, OUTPUT);
delay( 5000 );
analogWrite(6 , 0);
analogWrite(5 , 255);
delay( 2500 );
analogWrite(6 , 255);
delay( 2000 );
_ABVAR_1_voltage = 255 ;
_ABVAR_2_fan = 255 ;
}
void loop()
{
if (( ( analogRead(1) ) < ( 140 ) ))
{
_ABVAR_2_fan = 77 ;
}
else
{
_ABVAR_2_fan = ( ( ( 178 / 163 ) * analogRead(1) ) - ( 12903 / 163 ) ) ;
}
if (( ( _ABVAR_2_fan ) < ( 0 ) ))
{
_ABVAR_2_fan = 77 ;
}
else
{
if (( ( _ABVAR_2_fan ) > ( 255 ) ))
{
_ABVAR_2_fan = 255 ;
}
}
analogWrite(5 , _ABVAR_2_fan);
if (( ( analogRead(1) ) > ( 917 ) ))
{
_ABVAR_1_voltage = 0 ;
}
else
{
if (( ( analogRead(1) ) > ( 878 ) ))
{
_ABVAR_1_voltage = ( _ABVAR_1_voltage - 1 ) ;
delay( 20 );
}
if (( ( analogRead(1) ) < ( 817 ) ))
{
_ABVAR_1_voltage = ( _ABVAR_1_voltage + 1 ) ;
delay( 100 );
}
}
if (( ( _ABVAR_1_voltage ) < ( 0 ) ))
{
_ABVAR_1_voltage = 0 ;
}
else
{
if (( ( _ABVAR_1_voltage ) > ( 255 ) ))
{
_ABVAR_1_voltage = 255 ;
}
}
analogWrite(6 , _ABVAR_1_voltage);
}
click the MODIFY button in the upper right of the post window.
Highlight all you code.
click the "#" CODE TAGS button on the toolbar above just to the left of the QUOTE button.
click SAVE (at the bottom).
When you post code on the forum, please make a habit of using the code tags "#" button.