Francesco Pistone / Mbed 2 deprecated FORIGO_Modula_V4_R2_DE_BOX_ARGENTO_LAVORO

Dependencies:   mbed CANMsg

Files at this revision

API Documentation at this revision

Comitter:
francescopistone
Date:
Thu Jan 31 06:57:39 2019 +0000
Branch:
test_branch
Parent:
9:f0b5446add0c
Commit message:
xxx

Changed in this revision

canbus.hpp Show annotated file Show diff for this revision Revisions of this file
iodefinition.hpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
main.hpp Show annotated file Show diff for this revision Revisions of this file
diff -r f0b5446add0c -r 26a7f59ab667 canbus.hpp
--- a/canbus.hpp	Tue Oct 23 11:43:57 2018 +0000
+++ b/canbus.hpp	Thu Jan 31 06:57:39 2019 +0000
@@ -13,7 +13,7 @@
     #if defined(M3)
         const unsigned int  RX_ID = 0x104;
         const unsigned int  TX_ID = 0x105;
-        #define seedSensor
+        //#define seedSensor
     #endif
     #if defined(M4)
         const unsigned int  RX_ID = 0x106;
diff -r f0b5446add0c -r 26a7f59ab667 iodefinition.hpp
--- a/iodefinition.hpp	Tue Oct 23 11:43:57 2018 +0000
+++ b/iodefinition.hpp	Thu Jan 31 06:57:39 2019 +0000
@@ -1,25 +1,26 @@
-
 Watchdog wd;
 
 #if defined(speedMaster)
-    InterruptIn tractorSpeedRead(PB_1);         // define interrupt pin for tractor speed calculation MASTER MODE
-    DigitalOut quinconceOut(PA_5);              // sincro per quinconcio out
-    DigitalOut speedClock(PA_6);                // define out for speed clock repeater
-    InterruptIn DcEncoder(PB_2);                // define input for reading speed of seed wheel with fixed 25 hole
+    InterruptIn tractorSpeedRead(PB_1);     // define interrupt pin for tractor speed calculation MASTER MODE
+    DigitalOut quinconceOut(PA_0,PullUp);                                  // sincro per quinconcio out
+    DigitalIn quinconceIn(PA_1,PullUp);
+    //DigitalOut ProvaSincro(D8,PullUp);
+    InterruptIn DcEncoder(PA_14);
 #else
-    InterruptIn tractorSpeedRead(PB_6);         // define interrupt pin for tractor speed calculation SLAVE MODE
-    InterruptIn quinconceIn(PA_9);
-    DigitalIn quinconceOut(PA_5,PullUp);        // sincro per quinconcio out
-    InterruptIn DcEncoder(PB_2);                // define input for reading speed of seed wheel with fixed 25 hole
-    DigitalOut speedClock(PA_6);                // define out for speed clock repeater
+    InterruptIn tractorSpeedRead(PA_5);     // define interrupt pin for tractor speed calculation SLAVE MODE
+    //DigitalIn quinconceIn(PA_0,PullUp);
+    InterruptIn quinconceIn(PA_0);
+    DigitalIn quinconceOut(PA_1,PullUp);                                  // sincro per quinconcio out
+    InterruptIn DcEncoder(PA_14);
 #endif
 
 DigitalIn TBzeroPinInputRev(PB_11);             // define input of reading zero position of distributor wheel
+//DigitalIn ElementPosition(PB_2);                // define input for reading if seed element is down or up for master module, speed clock for slave
+InterruptIn ElementPosition(PB_2);                // define input for reading speed of seed wheel with fixed 25 hole
 DigitalIn seedWheelZeroPinInputRev(PB_12);      // define input of reading zero position of seeding wheel
-DigitalIn seedLevel(PB_1);                      // define input for reading seed level on tank
-InterruptIn seedCheck(PA_7);                      // define input for reading seed passage to picks
 DigitalIn buttonUser(PC_13);                    // pulsante su scheda
 
+DigitalOut speedClock(PA_6);                    // define out for speed clock repeater
 
 InterruptIn pwmCheck(PB_13);
 PwmOut SDmotorPWM(PB_13);                       // define frequency command for seeding whell motor driver
@@ -31,7 +32,7 @@
 
 DigitalOut TBmotor_M1(PC_8);                    // TB motor step division M1
 DigitalOut TBmotor_M2(PC_6);                    // TB motor step division M2
-DigitalOut TBmotor_M3(PC_5);                    // TB motor step division M3
+DigitalOut TBmotor_M3(PC_6);                    // TB motor step division M3
 DigitalOut TBmotorRst(PC_4);                    // TB motor driver reset
 DigitalOut TBmotorStepOut(PB_3);                // TB motor step command
 DigitalOut TBmotorDirecti(PA_10);               // TB motor direction command
@@ -43,8 +44,8 @@
     DigitalOut led(PC_7);                           // ATTENZIONE: LED1 E' SU PA5 / D13
 #endif
 
-//DigitalIn zeroRequestIn(PB_6);          // define input of zero request for slave module
-//DigitalIn runRequestIn(PB_9);           // define input of run request for slave module
+DigitalIn zeroRequestIn(PB_6);          // define input of zero request for slave module
+DigitalIn runRequestIn(PB_9);           // define input of run request for slave module
 
 #if defined(canbusActive)
     CAN can1(PA_11,PA_12,100000);           // CAN BUS channel for communication with other slave and master consolle
@@ -54,10 +55,10 @@
 CANMessage rxMsg;
 
 #if defined(pcSerial)
-    Serial pc(USBTX, USBRX,256000);         // serial channel for PC communication
+    Serial pc(USBTX, USBRX,250000);         // serial channel for PC communication
 #else
     #if defined(speedTime)
-        Serial pc(USBTX, USBRX,256000);         // serial channel for PC communication
+        Serial pc(USBTX, USBRX,250000);         // serial channel for PC communication
     #endif
 #endif
 
diff -r f0b5446add0c -r 26a7f59ab667 main.cpp
--- a/main.cpp	Tue Oct 23 11:43:57 2018 +0000
+++ b/main.cpp	Thu Jan 31 06:57:39 2019 +0000
@@ -838,7 +838,7 @@
         SDmotorInA=1;
         SDmotorInB=1;
     }else{
-        if (DC_forward==0){
+        if (DC_forward==1){
             SDmotorInA=1;
             SDmotorInB=0;
         }else{
diff -r f0b5446add0c -r 26a7f59ab667 main.hpp
--- a/main.hpp	Tue Oct 23 11:43:57 2018 +0000
+++ b/main.hpp	Thu Jan 31 06:57:39 2019 +0000
@@ -11,8 +11,8 @@
 
 // INDIRIZZAMENTO CAN BUS
 //#define M1
-//#define M2
-#define M3
+#define M2
+//#define M3
 //#define M4
 //#define M5
 //#define M6
@@ -42,7 +42,7 @@
 //#define provaStepper
 //#define provaDC
 #define startCycleSimulation 1
-#define correzioneAttiva 1
+#define correzioneAttiva 0
 //#define simulaPerCan
 //#define simulaBanco