![Adafruit Feather M4 Express Скачать руководство пользователя страница 21](http://html1.mh-extra.com/html/adafruit/feather-m4-express/feather-m4-express_manual_2845857021.webp)
The above shows the Micro USB jack (left), Lipoly JST jack (top left), as well as the changeover diode (just to the right
of the JST jack) and the Lipoly charging circuitry (to the right of the JST jack). There's also a CHG LED, which will light
up while the battery is charging. This LED might also flicker if the battery is not connected.
Power supplies
You have a lot of power supply options here! We bring out the BAT pin, which is tied to the lipoly JST connector, as
well as USB which is the +5V from USB if connected. We also have the 3V pin which has the output from the 3.3V
regulator. We use a 500mA peak regulator. While you can get 500mA from it, you can't do it continuously from 5V as it
will overheat the regulator. It's fine for, say, powering an ESP8266 WiFi chip or XBee radio though, since the current
draw is 'spikey' & sporadic.
Measuring Battery
If you're running off of a battery, chances are you wanna know what the voltage is at! That way you can tell when the
battery needs recharging. Lipoly batteries are 'maxed out' at 4.2V and stick around 3.7V for much of the battery life,
then slowly sink down to 3.2V or so before the protection circuitry cuts it off. By measuring the voltage you can quickly
tell when you're heading below 3.7V
To make this easy we stuck a double-100K resistor divider on the BAT pin, and connected it to A6 which is not
exposed on the feather breakout
In Arduino, you can read this pin's voltage, then double it, to get the battery voltage.
For CircuitPython, we've written a
get_voltage()
helper function to do the math for you. All you have to do is call the
function, provide the pin and print the results.
// Arduino Example Code snippet
#define VBATPIN A6
float measuredvbat = analogRead(VBATPIN);
measuredvbat *= 2; // we divided by 2, so multiply back
measuredvbat *= 3.3; // Multiply by 3.3V, our reference voltage
measuredvbat /= 1024; // convert to voltage
Serial.print("VBat: " ); Serial.println(measuredvbat);
© Adafruit Industries
https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51
Page 26 of 183
Содержание Feather M4 Express
Страница 1: ...Adafruit Feather M4 Express Created by lady ada Last updated on 2019 03 04 10 41 14 PM UTC...
Страница 5: ...Adafruit Industries https learn adafruit com adafruit feather m4 express atsamd51 Page 10 of 183...
Страница 58: ...Adafruit Industries https learn adafruit com adafruit feather m4 express atsamd51 Page 63 of 183...
Страница 164: ...Adafruit Industries https learn adafruit com adafruit feather m4 express atsamd51 Page 169 of 183...
Страница 168: ...Adafruit Industries https learn adafruit com adafruit feather m4 express atsamd51 Page 173 of 183...