How to find Voltage Level

Post Reply
chronister
Posts: 14
Joined: Fri Nov 28, 2014 2:17 am

How to find Voltage Level

Post by chronister »

Hi. I am writing some of my own code, and I would like to check the voltage level. I already have a voltage divider on my board. (It's the NanoWii from Hobby King.) The voltage is displayed correctly in the GUI, but I would like to access it in my own code (which I added in Output.cpp as a new model type) so that I can have the aircraft perform some specific functions when the voltage gets low. (I know MultiWii already provides a low voltage alarm. That is not what I want to do.)

Is there some way I can assign the voltage level to a variable that I can access in my code? Thanks for your help!

Nathan

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: How to find Voltage Level

Post by Hamburger »

If you follow the VBAT defines through the code in you will find the actual reading sequence togther with the struct and variable names.

B35
Posts: 4
Joined: Mon Jun 15, 2015 11:00 pm

Post by B35 »

It is stored in analog.vbat
As Hamburger said, take a look into code, you will find it here: Multiwii.cpp at line 464

chronister
Posts: 14
Joined: Fri Nov 28, 2014 2:17 am

Re: How to find Voltage Level

Post by chronister »

Thank you.

Post Reply