Pymate-Analog: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{PYMATE-HEADER}} {{PYMATE-TRAILER}}") |
No edit summary |
||
| Line 1: | Line 1: | ||
{{PYMATE-HEADER}} | {{PYMATE-HEADER}} | ||
{{PYMATE-HEADER}} | |||
== Important note == | |||
Charts and graphics are made to be easy to follow. | |||
The Pymate boards are drawed without connectors to avoids parallax shift. The real board are fitted with the connectors. | |||
== Analog Input == | |||
xxxx | |||
=== Wiring === | |||
[[File:pymate-adc.png|640px]] | |||
=== Coding === | |||
The following example query the state if imput 3 and displays the results on the REPL session. | |||
<syntaxhighlight lang="python" line>from pymate.pymateio import PymateIO | |||
from machine import ADC | |||
import time | |||
a4 = PymateIO( "IN4", ADC ) | |||
while True: | |||
print( "Adc 4 RAW = %s" % a4.read_u16() ) | |||
time.sleep( 0.2 ) | |||
</syntaxhighlight> | |||
Which would display values between 0 and 65535 in the REPL. | |||
{{PYMATE-TRAILER}} | {{PYMATE-TRAILER}} | ||
Revision as of 16:48, 30 April 2026
Important note
Charts and graphics are made to be easy to follow.
The Pymate boards are drawed without connectors to avoids parallax shift. The real board are fitted with the connectors.
Analog Input
xxxx
Wiring
Coding
The following example query the state if imput 3 and displays the results on the REPL session.
from pymate.pymateio import PymateIO
from machine import ADC
import time
a4 = PymateIO( "IN4", ADC )
while True:
print( "Adc 4 RAW = %s" % a4.read_u16() )
time.sleep( 0.2 )Which would display values between 0 and 65535 in the REPL.
PymateIO all right reserved © 2026 - Written by MCHobby for PymateIO