manro 0 Posted November 27, 2019 Share Posted November 27, 2019 Hi everyone, how can i read VCC on cc1310 launchpad respectively cc1350 sensortag with energia? I tried this, but without success: int getVCC() { analogReference(INTERNAL2V5); int data = (int)map(analogRead(A0), 0, 1023, 0, 5000); return data; } @Rei Vilo what do you think? Quote Link to post Share on other sites
Rei Vilo 695 Posted November 27, 2019 Share Posted November 27, 2019 Have a look at the AON always on functions on SWCU117H Chapter 18 Battery Monitor and Temperature Sensor. Quote Link to post Share on other sites
manro 0 Posted November 27, 2019 Author Share Posted November 27, 2019 Ok, I understand but how can i read BATMON Registers in energia? Quote Link to post Share on other sites
manro 0 Posted November 27, 2019 Author Share Posted November 27, 2019 just like this? #include <driverlib/aon_batmon.h> ... void setup() { AONBatMonEnable(); ... } void loop() { int BATstatus = AONBatMonBatteryVoltageGet(); ... } Quote Link to post Share on other sites
Rei Vilo 695 Posted November 28, 2019 Share Posted November 28, 2019 Have you tried? It is that simple. But you may want to convert it into mV. See https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/p/480930/1732219 The same code works on the CC1352 as well. Quote Link to post Share on other sites
manro 0 Posted November 28, 2019 Author Share Posted November 28, 2019 yes, i forgot convert value to millivolts, whole code is: #include <driverlib/aon_batmon.h> ... void setup() { AONBatMonEnable(); ... } void loop() { int BATstatus = AONBatMonBatteryVoltageGet(); BATstatus = (BATstatus * 125) >> 5; ... } so I started researching libraries in ...\power\hardware\cc13xx\4.9.1\system\source folder. I know that even you @Rei Vilo,are the author of libraries for several sensors, but I tried to import #include <ti/mw/sensors/SensorBmp280.h> and then call SensorBmp280_init() in setup function but something is wrong: undefined reference to `SensorBmp280_init' Quote Link to post Share on other sites
Rei Vilo 695 Posted November 28, 2019 Share Posted November 28, 2019 Have a look at the Weather Sensors Library available at https://github.com/rei-vilo/SensorsWeather_Library Quote Link to post Share on other sites
manro 0 Posted November 29, 2019 Author Share Posted November 29, 2019 @Rei Vilo as i wrote, i know about Weather Sensors Library and implementing communication with i2c sensors is straightforward. I was just wondering why I'm getting this error. Quote Link to post Share on other sites
Rei Vilo 695 Posted November 29, 2019 Share Posted November 29, 2019 Possible reasons: The ti/mw/sensors/SensorBmp280.h library is not designed for Energia. Other files may be needed. That's why I've recommended the Weather Sensors Library designed for Energia. I haven't read any mention to the Weather Sensors Library library before on this thread. For the ti/mw/sensors/SensorBmp280.h library, you may ask the E2E forum directly. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.