test
Revision 44:50aa0a0d1222, committed 2019-06-02
- Comitter:
- gorazdko
- Date:
- Sun Jun 02 08:56:57 2019 +0000
- Parent:
- 43:bda92a299378
- Child:
- 45:200518382f20
- Commit message:
- works almost with button
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Jun 02 08:52:41 2019 +0000
+++ b/main.cpp Sun Jun 02 08:56:57 2019 +0000
@@ -40,26 +40,12 @@
wait(3); // if (myButton)
-
- while (0)
- {
- for (int i=0; i<1000;i++)
- {
- wait_ms(20);
- motor_on();
- }
-
- for (int i=0; i<1000;i++)
- {
- wait_ms(20);
- motor_off();
- }
-
- }
+
while (1)
{
+ /*
for (int i=0; i<50*3; i++)
{
@@ -74,6 +60,18 @@
myServo.pulsewidth_us(MID); //NB in microseconds
wait_ms(TIME);
}
+ */
+
+ while (myButton)
+ {
+
+ myServo.pulsewidth_us(MIN); //NB in microseconds
+ wait_ms(TIME);
+ }
+
+
+ myServo.pulsewidth_us(MID); //NB in microseconds
+ wait_ms(TIME);
}