sjfujiang
Posts: 14
Joined: Wed Nov 25, 2015 1:18 am

how to control “sg90” Steering engine

Sun Nov 06, 2016 12:21 pm

http://www.besthobbysite.com/ebaystoreV3/image/SG90.jpg
how to control “sg90” Steering engine?

“GpioPinValue pinValue = GpioPinValue.Low;
pin27 = gpio.OpenPin(27);
pin27.SetDriveMode(GpioPinDriveMode.Output);
pin27.Write(pinValue);”
but sg90 does not work。

Major Tom
Posts: 65
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: how to control “sg90” Steering engine

Sun Nov 06, 2016 12:33 pm

It's a servo motor.

You need to generate servo control pulses on the signal wire (orange).

I recommend you start with pigpio.

You can read about pigpio here:
http://abyz.co.uk/rpi/pigpio/

For a quick test, start the pigpio daemon:

Code: Select all

sudo pigpiod
Then use pigs to generate the servo pulses:

Code: Select all

pigs SERVO 27 1500
Here, 27 is the GPIO number, and 1500 is the pulse width in microseconds. 1500 represents the "centre" position of the servo.
My circuit's dead, there's something wrong.

User avatar
DougieLawson
Posts: 39539
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: how to control “sg90” Steering engine

Sun Nov 06, 2016 1:04 pm

Slight problem, pigpiod and pigpio is Linux only, it doesn't exist on Win10 IoT.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Major Tom
Posts: 65
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: how to control “sg90” Steering engine

Sun Nov 06, 2016 1:13 pm

DougieLawson wrote:Slight problem, pigpiod and pigpio is Linux only, it doesn't exist on Win10 IoT.
You know, you're right. The sub-forum is not easily visible on the "New Posts" page. I'll double-check that next time before I post.

Anyway, maybe someone can help with Win10, or maybe the original poster will try Raspbian.
My circuit's dead, there's something wrong.

CAP-XPLAB
Posts: 13
Joined: Wed Mar 16, 2016 11:11 am

Re: how to control “sg90” Steering engine

Sun Nov 06, 2016 2:08 pm

perhaps can help: two projects make use of SG.
https://www.hackster.io/powerberry

Return to “Windows 10 for IoT”