SBB Micro
Source code for the self-balancing-bike microcontroller unit (Teensy 4.1-based). 🚀️
Loading...
Searching...
No Matches
Pin settings

Settings for the pins. More...

Macros

#define CS_IMU   0
 Chip select pin of IMU.
 
#define CS_MAG   2
 Chip select pin of MAG.
 
#define CS_DAC   3
 Chip select pin of DAC.
 
#define STEER_POS   A16
 Steer position analog input pin.
 
#define STEER_SPEED   A0
 Steer speed analog input pin.
 
#define ACT_CURR   A1
 Actual current analog input pin.
 
#define RIDER_TRQ   A17
 Rider torque analog input pin.
 
#define VOLTAGE   A15
 Battery voltage analog input pin.
 
#define FORK_DISP   A14
 Front fork displacement analog input pin.
 
#define PWM_PIN   18
 PWM pin for motor current reference.
 
#define MTR_EN_PIN   16
 Digital out for motor enable.
 
#define MTR_DIR_PIN   17
 Digital out for motor direction.
 
#define RELAY_EN_PIN   33
 Digital out for relay enable.
 
#define BR_DIR_PIN   21
 Digital out for brake motor direction.
 
#define BR_STEP_PIN   22
 Digital out for brake motor step.
 
#define BR_SLEEP_PIN   23
 Digital out for brake motor sleep.
 
#define ONOFF_STATE_PIN   36
 Digital in for on/off buttun state (diode between onoff and this).
 

Detailed Description

Settings for the pins.

Used pins in the Teensy 4.1 microcontroller. This includes the chip-select pins used for the SPI, analog input pin to read analog signals, PWM pin, and digital in and out pins.

Warning
Be careful to change the pin settings. Changes may lead to possible short circuits which kill the circuit.

Macro Definition Documentation

◆ ACT_CURR

#define ACT_CURR   A1

Actual current analog input pin.

◆ BR_DIR_PIN

#define BR_DIR_PIN   21

Digital out for brake motor direction.

◆ BR_SLEEP_PIN

#define BR_SLEEP_PIN   23

Digital out for brake motor sleep.

◆ BR_STEP_PIN

#define BR_STEP_PIN   22

Digital out for brake motor step.

◆ CS_DAC

#define CS_DAC   3

Chip select pin of DAC.

◆ CS_IMU

#define CS_IMU   0

Chip select pin of IMU.

◆ CS_MAG

#define CS_MAG   2

Chip select pin of MAG.

◆ FORK_DISP

#define FORK_DISP   A14

Front fork displacement analog input pin.

◆ MTR_DIR_PIN

#define MTR_DIR_PIN   17

Digital out for motor direction.

◆ MTR_EN_PIN

#define MTR_EN_PIN   16

Digital out for motor enable.

◆ ONOFF_STATE_PIN

#define ONOFF_STATE_PIN   36

Digital in for on/off buttun state (diode between onoff and this).

◆ PWM_PIN

#define PWM_PIN   18

PWM pin for motor current reference.

◆ RELAY_EN_PIN

#define RELAY_EN_PIN   33

Digital out for relay enable.

◆ RIDER_TRQ

#define RIDER_TRQ   A17

Rider torque analog input pin.

◆ STEER_POS

#define STEER_POS   A16

Steer position analog input pin.

◆ STEER_SPEED

#define STEER_SPEED   A0

Steer speed analog input pin.

◆ VOLTAGE

#define VOLTAGE   A15

Battery voltage analog input pin.