Windows IoT


Any Servo Library for Raspberry Pi 2


Hello,
I am creating the Windows 10 IoT Apps and I want control Servo from my RPI 2 board.
Could any one give me Servo Library URL or sample for RPI 2 control Servo?
Something like Arduino <Servo.h>:
myservo.attach(9);
myservo.write(90);
Thanks
Hi - I've done some work with the Raspberry Pi and Microsoft's Lightning Providers to generate PWM and control a servo using that. I posted about it here:
https://jeremylindsayni.wordpress.com/2016/05/16/a-servo-library-in-c-for-raspberry-pi-part-3-implementing-the-interface/
There's a nuget package for this too. I've only tested it in my own projects, but it worked nicely with my 9g Tower Pro servo. Hopefully the code in that post will provide you with some inspiration.
JeremyJeremy
While the RPi2 does have a PWM pin, it wasn’t really designed for servo control so isn’t currently exposed.
You do have some options though:
The first option is to manually simulate PWM using a GPIO pin. This is exactly how we control the servos in our little robot kit (https://microsoft.hackster.io/windowsiot/robot-kit).
Look at the “MotorControl.cs” file for sample code on this one.
The other option is to use a breakout board/ “pi hat” to get true PWM support. This guy (http://www.amazon.com/Adafruit-16-Channel-PWM-Servo-Raspberry/dp/B00SI1SPHS)
is popular for the pi and you can use it via an I2C interface.
This is a third device option that you can also consider:
https://www.pololu.com/product/1350
Additional mechanisms to handle PWMs are being considered so please stay tuned for additional updates in this area.Jonathan Tanner | Microsoft | Windows 10 IoT Core Insider Preview Support | This posting is provided 'as is' with no warranties and confers no rights.
While the RPi2 does have a PWM pin, it wasn’t really designed for servo control so isn’t currently exposed.
You do have some options though:
The first option is to manually simulate PWM using a GPIO pin. This is exactly how we control the servos in our little robot kit (https://microsoft.hackster.io/windowsiot/robot-kit).
Look at the “MotorControl.cs” file for sample code on this one.
The other option is to use a breakout board/ “pi hat” to get true PWM support. This guy (http://www.amazon.com/Adafruit-16-Channel-PWM-Servo-Raspberry/dp/B00SI1SPHS)
is popular for the pi and you can use it via an I2C interface.
This is a third device option that you can also consider:
https://www.pololu.com/product/1350
Additional mechanisms to handle PWMs are being considered so please stay tuned for additional updates in this area.Jonathan Tanner | Microsoft | Windows 10 IoT Core Insider Preview Support | This posting is provided 'as is' with no warranties and confers no rights.
Hi Jonathan,
On linux I have this option:
def set(property, value):
try:
f = open("/sys/class/rpi-pwm/pwm0/" + property, 'w')
f.write(value)
f.close()
except:
print("Error writing to: " + property + " value: " + value)
def setServo(angle):
set("servo", str(angle))
set("delayed", "0")
set("mode", "servo")
set("servo_max", "180")
set("active", "1")
is there a counterpart on Win IoT?
Hi - I've done some work with the Raspberry Pi and Microsoft's Lightning Providers to generate PWM and control a servo using that. I posted about it here:
https://jeremylindsayni.wordpress.com/2016/05/16/a-servo-library-in-c-for-raspberry-pi-part-3-implementing-the-interface/
There's a nuget package for this too. I've only tested it in my own projects, but it worked nicely with my 9g Tower Pro servo. Hopefully the code in that post will provide you with some inspiration.
JeremyJeremy

Related Links

What to exclude in UWF to receive updates from Store
How i connect raspberry as bluetooth speaker with android (using windows 10 IoT core) ?
SerialSample sends wrong Data
Prioritize Ethernet Connection Over Wifi Connection
Pi 3 keeps restarting during boot
Execute powershell commands from an exe(Windows form application) used in UWP app deployed on Dragonboard
Windows 10 IoT Enterprise UWF Servicing Screensaver
Calling Application.Current.Exit() in UWP cause Windows IoT Bluescreen?
W10 LTSB 2016 missing features?
IoTOnboardingTask Startup App
"Windows failed to start"
[UWP][UWF] What exclusion required in Unified Write Filter to preserve ApplicationLanguages.PrimaryLanguageOverride
v.10.0.15063.297 - USB, Ethernet, Onscreen keyboard, and more not working
Intel Joule Windows IoT Application Deployment
Using datawriter on a serial port output stream crashes application hard when calling StoreAsync()
Does SerialDevice.IsDataTerminalReadyEnabled work on RPi?

Categories

MSDN
Windows Phone Dev Center
DevLabs
Data Platform Developm...
Microsoft Sync Framework
Windows Embedded Standard
Feedback and Discussions
Bing
Windows Hardware Devel...
Expression
Archived Forums M
Forums Redesign - Q&A ...
MSBuild
Testing with Visual St...
Visual Studio Diagnost...
Visual Studio Graphics...
DirectShow Development
General Windows Deskto...
Windows Desktop Ribbon...
SharePoint 2010 - Gene...
SharePoint Legacy Vers...
SharePoint Legacy Vers...
Workflow Manager 1.0
Pricing & Billing
Azure Multi-Factor Aut...
Azure Media Services
Azure BizTalk Services
Azure Networking (DNS,...
Azure Data Factory
Azure Data Lake Analyt...
Claims based access pl...
Team Foundation Server...
Visual FoxPro General
BizTalk Server EDI and...
XML, System.Xml, MSXML...
TPL Dataflow
Visual Basic for Appli...
Microsoft Robotics - D...
.NET Compact Framework
Visual Studio Smart De...
SQL Service Broker
Microsoft StreamInsight
SQL Server In-Memory T...
Windows Embedded Compa...
SQL Server 2012 Integr...
SQL Server 2012 Analys...
SQL Server 2012 Report...
SQL Server 2012 Master...
WebsitePanel - Develop...
MSDN Magazine
Bing Maps WPF, WP7/8/8...
Bing Maps REST, SOAP, ...
Windows File Sharing P...
Exchange Server Protocols
Office XML, ODF, and B...
Silverlight Installati...
Programming Silverligh...
Designing with Silverl...
Customer Care Framework
Search Server: Install...
Retired SharePoint Wor...
Retired SharePoint Ent...
.NET Framework 4: Wind...
ASMX Web Services and ...
Charts & Reports in th...
Crystal Reports for Vi...
Direct3D 10
Dynamic Languages on .NET
HD DVD Interactivity A...
JScript for the .NET F...
Model-Based Testing wi...
Office Development wit...
NUI API and Programmin...
Software Transactional...
SyncFx - Feedback [Rea...
SQL Creation
SQL Server 2014 In Azu...
SQL Server 2014 Databa...
SQL Server 2014 In-Mem...
Team Foundation Server...
Transactions Programming
Tools for Windows Stor...
Visual Basic for Appli...
Visual Basic Power Packs
Visual Studio 2008 Exp...
Visual Studio 2008 IDE...
Visual Studio Code Ana...
Visual Studio Gallery ...
Visual Studio Source C...
Visual Studio Web Perf...
Windows Developer Prev...
Windows Events
Windows MultiPoint Mou...
Windows Presentation F...
Mango Update (Archived)
Expression Blend for W...
Windows Phone Preview ...
OneDrive Development (...
Microsoft Graph

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile