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