Open
Description
Hello,
with the code here below "attachInterrupt(digitalPinToInterrupt(LOGO), doIntLOGO, FALLING);" that didn't work, with
attachInterrupt(digitalPinToInterrupt(BUTTONA), doIntLOGO, FALLING); that worked (???). Why ?
#define BUTTONA (5)
#define BUTTONB (11)
#define LOGO (26)
#define RUN_MIC (28)
int toggle=1;
void gpio_init(void)
{
pinMode(BUTTONA, INPUT);
pinMode(BUTTONB, INPUT);
pinMode(LOGO, INPUT);
digitalWrite(RUN_MIC, LOW);
pinMode(RUN_MIC, OUTPUT);
}
// initialise interrupt
//
void int_init(){
attachInterrupt(digitalPinToInterrupt(LOGO), doIntLOGO, FALLING);
}
// LOGO handler (input select)
//
void doIntLOGO(){
if(toggle<0){
digitalWrite(RUN_MIC, LOW); // disable microphone
toggle=1;
}else{
digitalWrite(RUN_MIC, HIGH); // enable microphone
toggle=-1;
}
}
void setup() {
// put your setup code here, to run once:
gpio_init();
int_init();
}
void loop() {
// put your main code here, to run repeatedly:
}```
Metadata
Metadata
Assignees
Labels
No labels