Fact: you can use analog pins as digital pins with funcions like digitalSomething
This short, simple code is supposed to print 'p' when an output pin is directly connected to an input pin.
And it works as long I use the digital input pins
But when I connect anything to A0 and A1 (which would be pin 14 and 15) nothing happens. Even if i connect them to ground
I literally use one single patch cable, which I move, connecting input and output pins toghether - I previously set them, in the setup() - directly on the board
Ok, I'm sorry for my lack of context. Here is a photo.
With the function keyboard.print() included in the Keyboard.h library, I want to print a letter whenever an input pin is triggered to a LOW state, that is, when i connect the black cable from one end into an input pin, and the other end to an output pin or ground. This works on paper as there are 2 'for' cycles in the code that alternate the active pins.
Now while this perfectly works when I operate on all the digital i/o combinations, i can't wrap my head around the only two analog pins that i'm using, which don't work as intended. In the photo, for example the cable is connected from 3 (LOW output) to 14 or A0 (INPUT_PULLUP), but I get no 'p' on the notepad.
Are there some limitations on the analog pin uses?
The Leonardo is completely different from the Uno and A0 and A1 are not digital pins 14 and 15.
Checkout the variants/leonardo/pins_arduino.h definitions.
MarkT:
The Leonardo is completely different from the Uno and A0 and A1 are not digital pins 14 and 15.
Checkout the variants/leonardo/pins_arduino.h definitions.