Hello! I have a v3 and attempting to use a simple potentiometer but getting no change in analogRead from the specified pin. And even when the pin is not connected to anything the value is stuck at 0.999756. I get the same 0.999756 with pins 0, 2, 4, 13, 14, 25 and 27, but 0.0 on pins 19, 21, 22, 33 (these also don’t change when connected to the pot). Thoughts? Thank you in advance!
I saw on the CrowdSupply documentation that only pins 14, 25, 26, 27, and 33 support analogRead() (and pin 25 isn’t broken out for easy access). Keep in mind it’s 0-3.3V range. From testing right now on two v3’s running the latest v3.16, I was only able to get analogRead to work on pin 33.
Also wanted to make sure you place PotTest = analogRead(NN) in beforeRender() so that you get constantly updating info in the watcher. It’s not a one-time binding sort of thing, you probably want to set it up to re-read continuously.
Here’s code that worked for me on my v3:
var pin = 33
pinMode(pin, ANALOG)
export var potTest
export function beforeRender(delta) {
potTest = analogRead(pin)
}
export function render(index) {
v = index / pixelCount < potTest // Visual voltmeter
hsv(0, 1, v)
}
Thanks for checking! I’m good to go with the one input, thank you… just a pot for brightness. FYI this is for pimping out a friend’s wheelchair … we’d rather he not be on his phone when he drives.
Thanks again for your help!