Working on a bodycontroll module for my honda, I'm having some issues with he language. To turn the turn
signals on with a temp switch should I use if statement?
If (turnbutton > 500)
{ //blink without delay
}
If (turnbutton < 500)
{ //end blink without delay
}
I know it's dumb to have to ask but im still learning and some of the tutorials aren't clear on how to combine various aspects of the language.
The goal is to use temporary buttons to operate two turn signals, high and low beam selector, and brake light with a subroutine for emergency flashers.
The issue I am having is writing code for the temp button to turn the turn signal on and keep them on untill the button is pressed again.
griffinzein:
The goal is to use temporary buttons to operate two turn signals, high and low beam selector, and brake light with a subroutine for emergency flashers.
The issue I am having is writing code for the temp button to turn the turn signal on and keep them on untill the button is pressed again.
So you want to use the switch as a toggle? In that case, take a look at the StateChangeDetection example.