#include <Arduino.h>
#include <FlexCAN_T4.h>
#include <math.h>
#include <elapsedMillis.h>
#include <logging.h>
#include "rpm.h"
Go to the source code of this file.
◆ AVG_SAMPLES
◆ BAMO_ACTUAL_CURRENT
#define BAMO_ACTUAL_CURRENT 0x5f |
◆ BAMO_DC_VOLTAGE
#define BAMO_DC_VOLTAGE 0xeb |
◆ BAMO_MOTOR_TEMP
#define BAMO_MOTOR_TEMP 0x49 |
◆ BAMO_MOTOR_TORQUE
#define BAMO_MOTOR_TORQUE 0xA0 |
◆ BAMO_MOTOR_VOLTAGE
#define BAMO_MOTOR_VOLTAGE 0x8A |
◆ BAMO_POWER_STAGE_TEMP
#define BAMO_POWER_STAGE_TEMP 0x4A |
◆ BAMO_RPM_MOTOR
#define BAMO_RPM_MOTOR 0xCE |
◆ BAMO_SPEED
◆ BRAKE_LIGHT
◆ BRAKE_LIGHT_BRIGHTNESS
#define BRAKE_LIGHT_BRIGHTNESS 150 |
◆ BRAKE_LIGHT_LOWER_THRESH
#define BRAKE_LIGHT_LOWER_THRESH 165 |
◆ BRAKE_LIGHT_MIN_ACTIVE_PERIOD
#define BRAKE_LIGHT_MIN_ACTIVE_PERIOD 200 |
◆ BRAKE_LIGHT_UPPER_THRESH
#define BRAKE_LIGHT_UPPER_THRESH 510 |
◆ BRAKE_MSG_1ST_BYTE
#define BRAKE_MSG_1ST_BYTE 0x90 |
◆ BRAKE_SENSOR_PIN
#define BRAKE_SENSOR_PIN A5 |
◆ C1_ID
◆ CAN_BAUD_RATE
#define CAN_BAUD_RATE 500000 |
◆ CAN_TRANSMISSION_PERIOD
#define CAN_TRANSMISSION_PERIOD 100 |
◆ CURRENT_SENSOR_PIN
#define CURRENT_SENSOR_PIN A4 |
◆ LEFT_WHEEL_ENCODER_PIN
#define LEFT_WHEEL_ENCODER_PIN 28 |
◆ LIMIT_RPM_INTERVAL
#define LIMIT_RPM_INTERVAL 500000 |
◆ LOGGING_PERIOD
#define LOGGING_PERIOD 10 |
◆ RIGHT_WHEEL_ENCODER_PIN
#define RIGHT_WHEEL_ENCODER_PIN 30 |
◆ RL_RPM_MSG_1ST_BYTE
#define RL_RPM_MSG_1ST_BYTE 0x12 |
◆ RPM_PUBLISH_PERIOD
#define RPM_PUBLISH_PERIOD 5000 |
◆ RR_RPM_MSG_1ST_BYTE
#define RR_RPM_MSG_1ST_BYTE 0x11 |
◆ SENSOR_SAMPLE_PERIOD
#define SENSOR_SAMPLE_PERIOD 20 |
◆ WPS_PULSES_PER_ROTATION
#define WPS_PULSES_PER_ROTATION 36 |
◆ average()
int average |
( |
int * |
buffer, |
|
|
int |
n |
|
) |
| |
◆ brakeLightControl()
bool brakeLightControl |
( |
int |
brake_val | ) |
|
◆ bufferInsert()
void bufferInsert |
( |
int * |
buffer, |
|
|
int |
n, |
|
|
int |
value |
|
) |
| |
◆ canbusSetup()
◆ canbusSniffer()
void canbusSniffer |
( |
const CAN_message_t & |
msg | ) |
|
◆ initMessages()
◆ loop()
◆ sendBrakeVal()
void sendBrakeVal |
( |
uint16_t |
brake_value | ) |
|
◆ setup()
◆ apps1
◆ apps2
◆ avgBuffer1
◆ avgtmp
◆ battery_voltage
◆ brake
◆ brake_light_active_timer
elapsedMillis brake_light_active_timer |
◆ brake_sensor_c3
CAN_message_t brake_sensor_c3 |
◆ brake_sensor_timer
elapsedMillis brake_sensor_timer |
◆ brake_val
◆ can1
FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_16> can1 |
Write CSV fields feature example.
Definition at line 87 of file main.cpp.
◆ canTimer
◆ current
◆ current_byte1
◆ current_byte2
◆ current_controll
CAN_message_t current_controll |
◆ current_message_bamo
CAN_message_t current_message_bamo |
◆ CURRENTtimer
elapsedMillis CURRENTtimer |
◆ I_actual
◆ last_wheel_pulse_rl
unsigned long last_wheel_pulse_rl |
◆ last_wheel_pulse_rr
unsigned long last_wheel_pulse_rr |
◆ lemos
◆ loggingInstance
◆ maxtmp
◆ mintmp
◆ motor_voltage
◆ motorTemp
◆ motorTemp2
◆ powerStageTemp
◆ powerStageTemp2
◆ R2D
◆ rl_rpm
◆ rl_rpm_msg
◆ rpm_max
◆ rpm_publisher_timer
elapsedMicros rpm_publisher_timer |
◆ rr_rpm
◆ rr_rpm_msg
◆ second_to_last_wheel_pulse_rl
unsigned long second_to_last_wheel_pulse_rl |
◆ second_to_last_wheel_pulse_rr
unsigned long second_to_last_wheel_pulse_rr |
◆ speed
◆ torque
◆ voltage
◆ writeTIMER