<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Core 2 ADC always min or max values]]></title><description><![CDATA[<p dir="auto">I have a Core 2 and the M5GO BOTTOM2.</p>
<p dir="auto">Attached to port B on the battery is a circuit that outputs a voltage between 0-3.3v. The output of the circuit is attached to GPIO 36. When plugged in, adc.read() always returns 4095, and when unplugged reads 0. It should be reading 1.5v (measured with multimeter). Any ideas what could be going wrong?</p>
<pre><code>from m5stack import *
from m5stack_ui import *
from uiflow import *
import machine
import time

screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)

v = None

label0 = M5Label('label0', x=77, y=74, color=0x000, font=FONT_MONT_14, parent=None)

adc0 = machine.ADC(36)
adc0.atten(machine.ADC.ATTN_0DB)
adc0.width(machine.ADC.WIDTH_12BIT)
while True:
  v = adc0.read()
  label0.set_text(str(v))
  wait_ms(5)


</code></pre>
]]></description><link>https://community.m5stack.com/topic/6325/core-2-adc-always-min-or-max-values</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 15:15:48 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6325.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 Apr 2024 18:38:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Core 2 ADC always min or max values on Fri, 12 Apr 2024 18:49:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jkeyser" aria-label="Profile: jkeyser">@<bdi>jkeyser</bdi></a><br />
never mind, changing gain fixed it</p>
<pre><code>adc0.atten(machine.ADC.ATTN_11DB)
</code></pre>
]]></description><link>https://community.m5stack.com/post/24765</link><guid isPermaLink="true">https://community.m5stack.com/post/24765</guid><dc:creator><![CDATA[jkeyser]]></dc:creator><pubDate>Fri, 12 Apr 2024 18:49:58 GMT</pubDate></item></channel></rss>