-
Notifications
You must be signed in to change notification settings - Fork 17.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AP_Scripting: added 32 motor example
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- This script is an example setting up a custom motor matrix mix | ||
|
||
local NUM_BANKS = 8 | ||
|
||
-- duplicate a quad 8x for 32 motors | ||
for i = 1, NUM_BANKS do | ||
local base = (i-1)*4 | ||
gcs:send_text(0, string.format("Setting up motor bank %u at %u", i, base)) | ||
MotorsMatrix:add_motor_raw(base+0, -1, 1, 1, base+2) | ||
MotorsMatrix:add_motor_raw(base+1, 1, -1, 1, base+4) | ||
MotorsMatrix:add_motor_raw(base+2, 1, 1, -1, base+1) | ||
MotorsMatrix:add_motor_raw(base+3, -1, -1, -1, base+3) | ||
end | ||
|
||
assert(MotorsMatrix:init(NUM_BANKS*4), "Failed to init MotorsMatrix") | ||
|
||
motors:set_frame_string(string.format("Motors%u", NUM_BANKS*4)) |