www.nexusrobot.com Robot Kits manual
17
digitalWrite(ledPin, LOW); // Set a low value to the ledPin
}
}
Arduino button
¾
Interrrupt control
Description
Specifies a function to call when an external interrupt occurs. Replaces any previous function that was
attached to the interrupt. Most Arduino boards have two external interrupts: numbers 0 (on digital pin 2)
and 1 (on digital pin 3). The Arduino Mega has an additional four: numbers 2 (pin 21), 3 (pin 20), 4 (pin
19), and 5 (pin 18).
Sample code
int pin = 13;
volatile int state = LOW;
void setup()
{
pinMode(pin, OUTPUT);
attachInterrupt(0, blink, CHANGE);
}
void loop()
{
digitalWrite(pin, state);
}
void blink()
{
state = !state;
}
Summary of Contents for Nexus Robot
Page 74: ...www nexusrobot com Robot Kits manual 70 Sample Wiring Diagram for RB004 2WD V2 0...
Page 92: ...www nexusrobot com Robot Kits manual 88 Diagram for Omni3WD_V1 0...
Page 96: ...www nexusrobot com Robot Kits manual 92 Diagram_Omni3WD_V3 3...
Page 118: ...www nexusrobot com Robot Kits manual 114 Sample Wiring Diagram for RB011 Mecanum 4WD V4 1...