name 'ADC' is not defined
-
Hello all,
ok, so, first of all : I'm new to all of this pycom programming cards...Secondly, I am having struggles making a card working.
I do have a LoPy with an extension board, whom version is V2.1a.
I did the updates on the boards, i'm working with Visual Studio Code with plugin Pymkr.Basically, i am just trying to get an analog info back from the pin16, where i have a moisture sensor plugged, a YL-69.
Question is, as i was never able to find it on internet....
Does anyone had bumped into the same issue? And if so, how can i manage to make that work? I'm kinda lost now guys...
Anyway, thanks for your answers!
Edit : I forgot to put my code... Here it is :
import machine
inPin = machine.ADC()
pin16 = inPin.channel(pin='P16',attn=ADC.ATTN_11DB)
print(pin16) -
@FabLab-Vosges said in name 'ADC' is not defined:
machine is missing. It has to beimport machine inPin = machine.ADC() pin16 = inPin.channel(pin='P16',attn=machine.ADC.ATTN_11DB) print(pin16()) -
Nice one!
It is working, i didn't thought about that....
Thanks!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login