adjusted protocol + timings
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
70cc0e86e4279026354563eb0a3b33e869f00fd4
|
b35ccb9d90fe91ce7d10bd2ce2da777099c8e675
|
||||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -44,6 +44,7 @@
|
|||||||
"**/*.a": true,
|
"**/*.a": true,
|
||||||
"**/*.lib": true,
|
"**/*.lib": true,
|
||||||
"**/*.out": true,
|
"**/*.out": true,
|
||||||
"**/*.dwo": true
|
"**/*.dwo": true,
|
||||||
|
"**/*.bin": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,8 @@ void setup() {
|
|||||||
mode = static_cast<enum NET_MODE>(EEPROM.read(MODE_ADDRESS));
|
mode = static_cast<enum NET_MODE>(EEPROM.read(MODE_ADDRESS));
|
||||||
|
|
||||||
rmt_config_t config = RMT_DEFAULT_CONFIG_TX(ALARM_PIN, RMT_CHANNEL_0);
|
rmt_config_t config = RMT_DEFAULT_CONFIG_TX(ALARM_PIN, RMT_CHANNEL_0);
|
||||||
config.clk_div = 80; // RMT clocks with 1MHz
|
// config.clk_div = 80; // RMT clocks with 1MHz
|
||||||
|
config.clk_div = 80; // RMT clocks with 4100kHz
|
||||||
config.tx_config.carrier_en = false;
|
config.tx_config.carrier_en = false;
|
||||||
config.tx_config.idle_level = RMT_IDLE_LEVEL_HIGH;
|
config.tx_config.idle_level = RMT_IDLE_LEVEL_HIGH;
|
||||||
ESP_ERROR_CHECK(rmt_config(&config));
|
ESP_ERROR_CHECK(rmt_config(&config));
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ void Cockpit::flashing(Color color, int state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Cockpit::writeLEDs() {
|
void Cockpit::writeLEDs() {
|
||||||
this->writeCommTimer();
|
// this->writeCommTimer();
|
||||||
for (int i = 0; i < this->leds; i++) {
|
for (int i = 0; i < this->leds; i++) {
|
||||||
this->writeCommand();
|
this->writeCommand();
|
||||||
|
|
||||||
@@ -327,7 +327,7 @@ void Cockpit::writeLEDs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Cockpit::writeLED(uint8_t led) {
|
void Cockpit::writeLED(uint8_t led) {
|
||||||
this->writeCommTimer();
|
// this->writeCommTimer();
|
||||||
for (int i = 0; i < this->leds; i++) {
|
for (int i = 0; i < this->leds; i++) {
|
||||||
this->writeCommand();
|
this->writeCommand();
|
||||||
|
|
||||||
@@ -357,7 +357,7 @@ void Cockpit::writeZero() {
|
|||||||
|
|
||||||
// costs 4 cp
|
// costs 4 cp
|
||||||
|
|
||||||
byte pattern = 0b11100000; // should be 0b11000000 <-hardware hack
|
byte pattern = 0b11000000; // should be 0b11000000 <-hardware hack
|
||||||
byte invPattern = ~pattern;
|
byte invPattern = ~pattern;
|
||||||
|
|
||||||
for (uint8_t i = 0; i < 8; i++) {
|
for (uint8_t i = 0; i < 8; i++) {
|
||||||
@@ -464,7 +464,8 @@ void Cockpit::writeOne() {
|
|||||||
// costs 4 cp
|
// costs 4 cp
|
||||||
|
|
||||||
// byte pattern = 0b11001100; // this is how it should be
|
// byte pattern = 0b11001100; // this is how it should be
|
||||||
byte pattern = 0b11101110; // hardware hack, because open collector is slow -> more 1 than 0
|
byte pattern = 0b11011000; // hardware hack, because open collector is slow -> more 1 than 0
|
||||||
|
// byte pattern = 0b10101010; // hardware hack, because open collector is slow -> more 1 than 0
|
||||||
byte invPattern = ~pattern;
|
byte invPattern = ~pattern;
|
||||||
|
|
||||||
for (uint8_t i = 0; i < 8; i++) {
|
for (uint8_t i = 0; i < 8; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user