Francesco Pistone
/
Viaro_SpandiConcime_V3_inizio
copia12092018
io_definitions.h@13:4d6114864f2d, 2018-11-16 (annotated)
- Committer:
- root@developer-sjc-indigo-compiler.local.mbed.org
- Date:
- Fri Nov 16 10:55:45 2018 +0000
- Revision:
- 13:4d6114864f2d
- Parent:
- 8:b01d4cb1857f
Added tag fine for changeset dde73cf20353
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
francescopistone | 8:b01d4cb1857f | 1 | //Serial pc(USB_TX, USB_RX); |
viaromassimo | 5:72bdc69d610d | 2 | #if defined(logActive) |
francescopistone | 8:b01d4cb1857f | 3 | //Serial pc(D1, D0, 9600); |
francescopistone | 8:b01d4cb1857f | 4 | Serial pc(D1, D0, 115200); |
viaromassimo | 5:72bdc69d610d | 5 | #endif |
nerit | 0:b0a79a3a9da8 | 6 | |
viaromassimo | 1:59c30e854dfb | 7 | InterruptIn WheelSensorPin(D5); //pin at which the wheel sensor is attached |
francescopistone | 6:3263fc9d7423 | 8 | //lettura rotazione ruota |
francescopistone | 7:dc3cb1a5764b | 9 | //l'interrupt triggera un evento quando un ingresso digitale varia |
viaromassimo | 1:59c30e854dfb | 10 | InterruptIn MotorSensorPin(D4); //pin connected to motor sensor pin |
francescopistone | 6:3263fc9d7423 | 11 | //lettura feedback motore |
viaromassimo | 1:59c30e854dfb | 12 | DigitalIn OnOffPin(D12); //pin connected to on/off switch |
francescopistone | 6:3263fc9d7423 | 13 | //enable |
nerit | 0:b0a79a3a9da8 | 14 | PwmOut MotorPwmPin(PA_1); //pin connected to motor - this must be a digital PWM pin |
francescopistone | 6:3263fc9d7423 | 15 | //controllo pwm velocità motore |
viaromassimo | 1:59c30e854dfb | 16 | DigitalIn PlusPercentPin(D3); //pin connected to +XX% switch |
francescopistone | 6:3263fc9d7423 | 17 | // velocità motore = k * velocità ruota : aumento il k |
viaromassimo | 1:59c30e854dfb | 18 | DigitalIn MinusPercentPin(D6); //pin connected to -XX% switch |
francescopistone | 6:3263fc9d7423 | 19 | // velocità motore = k * velocità ruota : dimiuisco il k |
nerit | 0:b0a79a3a9da8 | 20 | |
nerit | 0:b0a79a3a9da8 | 21 | DigitalOut SDmotorInB(PA_7); // sd motor half bridge direction selector |
francescopistone | 6:3263fc9d7423 | 22 | //comando del ponte ad H per decidere il verso di rotazione (+VDC -VDC) VEDI VNH3SP30 |
nerit | 0:b0a79a3a9da8 | 23 | DigitalOut SDmotorInA(PA_2); // SD motor half bridge direction selector |
francescopistone | 6:3263fc9d7423 | 24 | //comando del ponte ad H per decidere il verso di rotazione (-VDC +VDC) |
nerit | 0:b0a79a3a9da8 | 25 | DigitalIn enDiag_A(PA_4); // SD motor fault condition input A |
francescopistone | 6:3263fc9d7423 | 26 | // non usato |
nerit | 0:b0a79a3a9da8 | 27 | DigitalIn enDiag_B(PA_3); // SD motor fault condition input A |
francescopistone | 6:3263fc9d7423 | 28 | // non usato |
nerit | 0:b0a79a3a9da8 | 29 | AnalogIn SDcurrent(PA_0); // SD power current feedback |
francescopistone | 6:3263fc9d7423 | 30 | // non usato |
nerit | 0:b0a79a3a9da8 | 31 | DigitalOut led(LED1); |
nerit | 0:b0a79a3a9da8 | 32 | #if defined(canbusActive) |
nerit | 0:b0a79a3a9da8 | 33 | CAN can1(D10,D2,100000); // CAN BUS channel for communication with other slave and master consolle |
nerit | 0:b0a79a3a9da8 | 34 | #endif |
nerit | 0:b0a79a3a9da8 | 35 | CANMessage txMsg; |
nerit | 0:b0a79a3a9da8 | 36 | CANMessage rxMsg; |