- Tue Nov 08, 2022 2:20 pm
#236884
Hello!
I'm a beginner and struggling pin definitions in Arduino. paulvha started to set me straight over here: viewtopic.php?f=169&t=58525 but I'm moving on to adding buttons to my project and I'm clearly not getting it. I'm looking at the Schematic, Apollo3 Datasheet, and Integrations Guide here: https://www.sparkfun.com/products/15443.
When I connect a switch to the pin labelled 13 on the board, the following code works:
I obviously don't understand the difference between the AX pins and the X pins or how to configure them. What can each of them be and how do I make them so?
Thanks in advance.
-M
I'm a beginner and struggling pin definitions in Arduino. paulvha started to set me straight over here: viewtopic.php?f=169&t=58525 but I'm moving on to adding buttons to my project and I'm clearly not getting it. I'm looking at the Schematic, Apollo3 Datasheet, and Integrations Guide here: https://www.sparkfun.com/products/15443.
When I connect a switch to the pin labelled 13 on the board, the following code works:
Code: Select all
If I wanted to use pin A14 instead, what would that look like?int soundOut = A16;
int buttonOne = 13;
void setup() {
// put your setup code here, to run once:
pinMode(soundOut, OUTPUT);
pinMode(buttonOne, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(buttonOne) == LOW){
tone(soundOut, 440, 100);
delay(100);
tone(soundOut, 880, 100);
delay(100);
}
}
I obviously don't understand the difference between the AX pins and the X pins or how to configure them. What can each of them be and how do I make them so?
Thanks in advance.
-M