Using Sleep Delay in C on Windows IoT

0 votes
I'm trying to program a stepper motor in C# using Visual Studio. I have it connected to a Raspberry Pi 2 running Windows 10 IoT Core.

Motor: HSY214 - F0.8 A NEMA8 - Steppermotor
Driver: A4988

I need to write a time-bound code for a background application but sleep and delay are missing, and I'm only being able to program via Remote-Debug. Just somehow, even System.Threading.Thread.Sleep(time) is not available. I also tried to use a timer but the time being different between each step makes it difficult to implement. Like, there are 5 steps that go fast, then 2 steps go slow, then 5 steps fast again, 2 steps slow again and so on.So, can someone please guide me or point me in the right direction so as to how I could program the motor correctly?
Aug 28, 2018 in IoT (Internet of Things) by Bharani
• 4,660 points
2,262 views

1 answer to this question.

0 votes
You'll be glad to know that C# support for Software PWM and Hardware PWM has finally been added to the iot-devices project(https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.delay?redirectedfrom=MSDN&view=netframework-4.7.2#System_Threading_Tasks_Task_Delay_System_Int32_). So, you can, now, implement functions similar to the Thread.Sleep using System.Threading.Tasks.Task.Delay(https://github.com/jbienzms/iot-devices).
answered Aug 28, 2018 by DataKing99
• 8,250 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer

Display time in a Windows Core IoT app with a clock!

It is possible, but you should understand ...READ MORE

answered Jul 10, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,554 views
0 votes
1 answer

Publishing commands to device in IBM IoT using MQTT in Java

If you are publishing from an application, ...READ MORE

answered Jul 27, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
1,506 views
0 votes
1 answer
0 votes
1 answer

Using FIWARE to start Cygnus as a Service in IoT Solution

Cygnus is supposed to create /var/run/cygnus/ when started. You ...READ MORE

answered Aug 13, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
939 views
0 votes
1 answer
0 votes
1 answer

USB Mobile Broadband Modem on Windows 10 IoT

I was looking for a solution too, ...READ MORE

answered Jul 9, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
2,735 views
0 votes
1 answer

Deploy my Windows 10 IOT core application locally!

Of course, you, can! That is, in ...READ MORE

answered Jul 17, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,109 views
0 votes
1 answer

Finding the Unicast, DNS and Gateway Address in UWP

Try the PInvoke api methods from Iphlpapi.dll. ...READ MORE

answered Aug 20, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
906 views
0 votes
1 answer

Autostart published Application on Windows 10 IoT

It can be done by making changes ...READ MORE

answered Jul 13, 2018 in IoT (Internet of Things) by DataKing99
• 8,250 points
1,794 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP