mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-02-17 06:29:15 +01:00
Compare commits
2 Commits
5f65fd5944
...
3d6c935308
Author | SHA1 | Date | |
---|---|---|---|
|
3d6c935308 | ||
|
fba9a30813 |
@ -297,7 +297,12 @@ void DCCTimer::DCCEXInrushControlOn(uint8_t pin, int duty, bool inverted) {
|
||||
int ADCee::init(uint8_t pin) {
|
||||
pinMode(pin, ANALOG);
|
||||
adc1_config_width(ADC_WIDTH_BIT_12);
|
||||
// Espressif deprecated ADC_ATTEN_DB_11 somewhere between 2.0.9 and 2.0.17
|
||||
#ifdef ADC_ATTEN_11db
|
||||
adc1_config_channel_atten(pinToADC1Channel(pin),ADC_ATTEN_11db);
|
||||
#else
|
||||
adc1_config_channel_atten(pinToADC1Channel(pin),ADC_ATTEN_DB_11);
|
||||
#endif
|
||||
return adc1_get_raw(pinToADC1Channel(pin));
|
||||
}
|
||||
int16_t ADCee::ADCmax() {
|
||||
|
@ -97,6 +97,18 @@
|
||||
new MotorDriver(25/* 3*/, 19/*12*/, UNUSED_PIN, 13/*9*/, 35/*A2*/, 1.27, 5000, 36 /*A4*/), \
|
||||
new MotorDriver(23/*11*/, 18/*13*/, UNUSED_PIN, 12/*8*/, 34/*A3*/, 1.27, 5000, 39 /*A5*/)
|
||||
|
||||
// EX-CSB1 with integrated motor driver definition
|
||||
#define EXCSB1 F("EXCSB1"),\
|
||||
new MotorDriver(25, 0, UNUSED_PIN, -14, 34, 2.23, 5000, 19), \
|
||||
new MotorDriver(27, 15, UNUSED_PIN, -2, 35, 2.23, 5000, 23)
|
||||
|
||||
// EX-CSB1 with EX-8874 stacked on top for 4 outputs
|
||||
#define EXCSB1_WITH_EX8874 F("EXCSB1_WITH_EX8874"),\
|
||||
new MotorDriver(25, 0, UNUSED_PIN, -14, 34, 2.23, 5000, 19), \
|
||||
new MotorDriver(27, 15, UNUSED_PIN, -2, 35, 2.23, 5000, 23), \
|
||||
new MotorDriver(26, 5, UNUSED_PIN, 13, 36, 1.52, 5000, 18), \
|
||||
new MotorDriver(16, 4, UNUSED_PIN, 12, 39, 1.52, 5000, 17)
|
||||
|
||||
#else
|
||||
// STANDARD shield on any Arduino Uno or Mega compatible with the original specification.
|
||||
#define STANDARD_MOTOR_SHIELD F("STANDARD_MOTOR_SHIELD"), \
|
||||
|
Loading…
Reference in New Issue
Block a user