Skip to content

Commit ef79532

Browse files
committed
Merging master bug fixes
1 parent 896db56 commit ef79532

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

ljswitchboard-module_manager/lib/switchboard_modules/lua_script_debugger/premade_scripts/advanced_scripts/pid_example.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--[[
2-
Name: 13_pid_example.lua
2+
Name: pid_example.lua
33
Desc: This is a PID example script that sets a DAC0 output using AIN2 for
44
feedback
55
Note: Gets a setpoint from a host computer. Host computer writes the new

ljswitchboard-module_manager/lib/switchboard_modules/lua_script_debugger/premade_scripts/analog_output/output_sine_wave.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ local offset = 2.5
1818
local frequency = 1
1919
-- Radians per step. A smaller number increases waveform resolution
2020
local radstep = .1
21-
local interval = 1000 / (2 * (frequency / radstep) )
21+
local interval = 1000 / (2 * math.pi * (frequency / radstep))
2222
local rads = 0
2323
LJ.IntervalConfig(0, interval)
2424

ljswitchboard-module_manager/lib/switchboard_modules/lua_script_debugger/premade_scripts/toggle_dio_1hz.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ while true do
3131
print(diostatus, "high")
3232
end
3333
-- Apply the change to the DIO pin register (toggle on or off)
34-
MB.W(outpin, diostatus)
34+
MB.W(outpin, 0, diostatus)
3535
end
3636
end

ljswitchboard-module_manager/lib/switchboard_modules/lua_script_debugger/premade_scripts_addresses/analog_output/output_sine_wave.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ local offset = 2.5 --offset, or centerline voltage in volts
1313
local frequency = 1 --frequency in Hz
1414
local rad_step = .1 --radians per step. A smaller number increases waveform resolution
1515

16-
local timer_ms = 1000 / (2 * (frequency / rad_step) )
16+
local timer_ms = 1000 / (2 * math.pi * (frequency / rad_step))
1717
local rads = 0
1818

1919
LJ.IntervalConfig(0, timer_ms) --set interval to 10 for 10ms

0 commit comments

Comments
 (0)