Skip to content

Commit

Permalink
AP_Scripting: Add mcu_voltage
Browse files Browse the repository at this point in the history
Add analog:mcu_voltage() to get a reading of the mcu voltage
  • Loading branch information
haydendonald authored and tridge committed Oct 16, 2024
1 parent e9cdc46 commit 0ddaae5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/AP_Scripting/docs/docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,10 @@ analog = {}
---@return number -- MCU temperature
function analog:mcu_temperature() end

-- return The current MCU voltage
---@return number -- MCU voltage
function analog:mcu_voltage() end

-- desc
---@return AP_HAL__AnalogSource_ud|nil
function analog:channel() end
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_Scripting/generator/description/bindings.desc
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ singleton hal.analogin literal
singleton hal.analogin method channel AP_HAL::AnalogSource ANALOG_INPUT_NONE'literal
singleton hal.analogin method mcu_temperature float
singleton hal.analogin method mcu_temperature depends HAL_WITH_MCU_MONITORING
singleton hal.analogin method mcu_voltage float
singleton hal.analogin method mcu_voltage depends HAL_WITH_MCU_MONITORING

include AP_Motors/AP_MotorsMatrix_Scripting_Dynamic.h depends APM_BUILD_TYPE(APM_BUILD_ArduPlane)||APM_BUILD_COPTER_OR_HELI
singleton AP_MotorsMatrix_Scripting_Dynamic depends APM_BUILD_TYPE(APM_BUILD_ArduPlane)||APM_BUILD_COPTER_OR_HELI
Expand Down

0 comments on commit 0ddaae5

Please sign in to comment.