MCookie-Base
From Microduino Wiki
Revision as of 04:00, 7 July 2016 by 172.31.23.3 (talk) (Created page with "{| style="width: 800px;" | |400px|thumb|right|mCookie-Base mCookie-Base is a discharging management module that the single lithium battery boo...")
ContentsFeatures
Specification
Description of pins Power Supply
DocumentsMain Components
Development
//Voltage detection pin, A7pin
#define PIN_bat A7 //BAT
//MCU working voltage, which need to be chosen according to the situation.
#define MCU_VOLTAGE 50
//#define MCU_VOLTAGE 33
#define _V_max 41 //4.2V
#define _V_min 35 //3.7V
#define _V_fix 0.2 //fix battery voltage
#define _V_math(Y) (_V_fix+((Y*analogRead(PIN_bat)/1023.0f)/(33.0f/(51.0f+33.0f))))
uint8_t batVoltage() {
return constrain(_V_math(MCU_VOLTAGE), _V_min, _V_max);
} Application
FAQHistoryGallery |