PullupDev/src/config.h
pxzleo ae901e70cc 增加电机缓启动和停止
增加舵机锁定和解锁时和电机的配合,防止电机还在转就锁定和防止正在解锁电机开始高速旋转导致磨损
入仓长度随速度平方比例变化,防止速度太快刹不住车--
放货物变慢距离是否也需要这样还不确定,测试确定
增加速度,按实际330的速度收放货物,按钮双击和长按速度也加快
2023-05-07 02:56:19 +08:00

38 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
////////////
//定义公共结构,变量,硬件接口等
///
//
//硬件接口定义////////////////////////////
// 按钮
#define BTN_UP 23 // 收线开关 接线BTN_UP---GND
#define BTN_DOWN 22 // 放线开关
#define BTN_CT 21 // 到顶检测开关
#define BTN_TEST 18 // 测试开关
// 称重传感器- HX711
#define LOADCELL_DOUT_PIN 16
#define LOADCELL_SCK_PIN 17
///////////////////////////////////////////
#define SERVO_PIN 14 //锁定舵机PWM控制脚
////LED
#define LED_DATA_PIN 25
//Moto-CAN
#define MOTO_CAN_RX 26
#define MOTO_CAN_TX 27
/////
#define WEIGHT_SCALE 276 //这是缩放值根据砝码实测516.f
#define TM_INSTORE_DELAY 200 // 入仓动力延时关闭时间 ms
enum HookStatus
{
HS_UnInit, //还未初始化
HS_Down, // 货物下放中
HS_DownSlow, //货物慢速下放中 --接近地面慢速,不受设置速度影响
HS_WaitUnhook, //等待脱钩
HS_Up, // 回收中
HS_InStore, // 入仓中 --慢速,不受设置速度影响
HS_Locked, //已到顶部锁定
HS_Stop //已停止
};