Télécharger Imprimer la page

Raspberry PICO Mode D'emploi page 41

Publicité

8.2.3 Interruptions
const
byte interruptPin
int
numberOfInterrupts
void
setup() {
Serial.begin(115200);
pinMode(interruptPin, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(interruptPin), handleInterrupt,
FALLING);
}
void
handleInterrupt() {
numberOfInterrupts++;
Serial.print("An interrupt has occurred. Total:
Serial.println(numberOfInterrupts);
}
void
loop() {
}
= 15;
= 0;
");

Publicité

loading

Ce manuel est également adapté pour:

Pico w