Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 8:de64672c240f
- Parent:
- 7:27ea14e58788
- Child:
- 9:d771a576e4fc
--- a/main.cpp Fri May 04 11:41:31 2018 +0000
+++ b/main.cpp Fri May 04 12:41:56 2018 +0000
@@ -18,11 +18,11 @@
DigitalIn endX2(D10);
// IHM for development
-AnalogIn joyX(A0);
-AnalogIn joyY(A1);
+AnalogIn joyX(A1);
+AnalogIn joyY(A0);
-DigitalIn zUp(D6);
-DigitalIn zDwn(D7);
+DigitalIn zUp(D7);
+DigitalIn zDwn(D6);
// variables definition
int modeStatus = 1;
@@ -49,8 +49,8 @@
float Y = 0;
// machine parameters
-float xPitch = 5.0;
-float yPitch = 5.0;
+float xPitch = 3.0;
+float yPitch = 3.0;
float motor_steps_by_rotation = 200.0;
float step_mode = 0.5;
@@ -78,15 +78,15 @@
valZDwn = zDwn;
if(valX > 0.7){
- if(x_dir){
- x_dir = 0;
+ if(!x_dir){
+ x_dir = 1;
}
activeX = 1;
totalX-=1;
}
else if(valX < 0.3){
- if(!x_dir){
- x_dir = 1;
+ if(x_dir){
+ x_dir = 0;
}
activeX = 1;
totalX+=1;