avec thread

Dependencies:   mbed

Fork of T2_STM32 by Atechsys

Revision:
4:b01a3ce6ef01
Parent:
3:dfbd0ce2963a
--- a/Cylinder.h	Sun Jan 14 15:56:09 2018 +0000
+++ b/Cylinder.h	Sun Jan 14 17:39:09 2018 +0000
@@ -97,10 +97,17 @@
 }
 
 void Cylinder::Origin(int OriginSensor) {
-  digitalWrite(sdirPin, LOW);
-  analogWrite(sstepPin, 127);
-  while (digitalRead(sOriginSensor) == true);
-  analogWrite(sstepPin, 0);
+  
+  int periode = 100;
+  DigitalOut test_sortie_pwm(PD0);
+  SendPWM_Carre(periode, test_sortie_pwm)
+  while(DigitalOut(OriginSensor)==true);
+  SendPWM_Nul(test_sortie_pwm);
+  //digitalWrite(sdirPin, LOW);
+  //analogWrite(sstepPin, 127);
+  //while (digitalRead(sOriginSensor) == true);
+  //analogWrite(sstepPin, 0);
+  */
 }
 
 #endif
\ No newline at end of file