Editing Tutorial Analog IN
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 54: | Line 54: | ||
[[File:Rldr.JPG|300px]] | [[File:Rldr.JPG|300px]] | ||
− | == Code Example | + | == Code Example == |
This makes Pin 34 an analog input and set it to 12 bit. It reads the analog value every second and print it to the console- | This makes Pin 34 an analog input and set it to 12 bit. It reads the analog value every second and print it to the console- | ||
Line 64: | Line 64: | ||
analogPin = ADC(Pin(34)) | analogPin = ADC(Pin(34)) | ||
analogPin.atten(ADC.ATTN_11DB) | analogPin.atten(ADC.ATTN_11DB) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
while True: | while True: |