Hide minor edits - Show changes to markup
Reads the joystick's button and returns if its state is 0 or 1023.
Reads the joystick's button and returns if its state is 0 or 1023. If you prefer something more consistent with the readButton() function, you may want to use readJoystickButton() instead. That function does the same as this, but returns LOW when the joystick button is pressed, and HIGH when not pressed.
Reads the joystick's button and returns if its state is HIGH or LOW.
Reads the joystick's button and returns if its state is 0 or 1023.
0 when pressed, 1023 when not pressed.
int button = Esplora.readJoystcikSwitch();
if(button == HIGH)
int button = Esplora.readJoystickSwitch();
if(button == 0)
readJoystickSwitch()
Esplora.readJoystickSwitch()
(:sourceend:)
(:sourceend:)
HIGH if pressed, and LOW if not.
Read the joystick central button and returns if its stat is HIGH or LOW.
Reads the joystick's button and returns if its state is HIGH or LOW.
readJoystcikSwitch()
readJoystickSwitch()
return the state of the joystick central button when the function was called.
HIGH if pressed, and LOW if not.
[@ void setup(){}
(:source lang=arduino tabwidth=4:) void setup(){
// nothing in setup
}
int button = Esplora.readJoystcikSwitch();
if(button == HIGH)
int button = Esplora.readJoystcikSwitch();
if(button == HIGH)
else {
else {
@]
(:sourceend:)
Read the joystick central button and returns if its stat is HIGH or LOW.
readJoystcikSwitch()
none
return the state of the joystick central button when the function was called.
void setup(){}
void loop()
{
int button = Esplora.readJoystcikSwitch();
if(button == HIGH)
{
Esplora.writeRed(255);
}
else {
Esplora.writeRed(0);
}
}