Closed jfd5041 closed 3 years ago
Yep. Looks like copy pasta from the gpio_example
sketch, which is the OUTPUT example for the GPIO. That one would blink an LED attached to the pin. The gpio_input_example
is the INPUT example and just prints pin state to the serial monitor. There are no LEDs involved.
Want to PR something with a better first line comment?
Yes, I'll do it while learning how to use Git and GitHub. Git wasn't even around before I retired; we used SCCS, CVS, and then Subversion. On Tuesday, February 2, 2021, 05:46:50 PM PST, Carter Nelson notifications@github.com wrote:
Yep. Looks like copy pasta from the gpio_example sketch, which is the OUTPUT example for the GPIO. That one would blink an LED attached to the pin. The gpio_input_example is the INPUT example and just prints pin state to the serial monitor. There are no LEDs involved.
Want to PR something with a better first line comment?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Closing. Fixed with #13 . Thanks @jfd5041
Arduino board: UNO
Arduino IDE version (found in Arduino -> About Arduino menu): 1,8.14
List the steps to reproduce the problem below (if possible attach a sketch or copy the sketch code in too): Line 1 of the file _gpio_inputexample.ino reads as follows: / This example will use the GPIO pin to blink an led / There is no further reference to an led; the example is for input TO the GPIO pin. Instead, the comment should be something like: /*
Here is the complete code listing directly from the AS7341 library examples folder: / This example will use the GPIO pin to blink an led /
include
Adafruit_AS7341 as7341;
void setup() { Serial.begin(115200);
// Wait for communication with the host computer serial monitor while (!Serial) { delay(1); }
if (!as7341.begin()){ Serial.println("Could not find AS7341"); while (1) { delay(10); } } // set the GPIO direction to input so we can read the input if (!as7341.setGPIODirection(AS7341_GPIO_INPUT)){ Serial.println("Could not set the GPIO direction to true to enable"); } }
void loop() { bool gpio_value = as7341.getGPIOValue();
Serial.print("GPIO pin is "); if (gpio_value){ Serial.println("high"); } else { Serial.println("Low"); } delay(500); }