Anonymous user
→Programming
No edit summary |
Tags: Mobile edit Mobile web edit |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 8:
}}
'''Servo''' is similar to [[Motor]], but when activated by electricity, it cannot spin automatically. It can be interacted to add the angles of hinge with the configuration of "AngleStep",
FlipFlop mode Polysilicon can set its angles to 0.
==Description==
Line 19 ⟶ 21:
====Example====
<syntaxhighlight lang="lua" line="1">
local servo = GetPartFromPort(1,
local switch = GetPartFromPort(2,"Switch") --A switch must be connected to a servo and a PowerCell. It must be between servo and PowerCell.
switch:Configure({SwitchValue=false})
servo:SetAngle(math.rad(math.random(1,360)))
wait(2)
switch:Configure({SwitchValue=true})
</syntaxhighlight>
|