Fixed beep counter interraction
- beep counter interraction fix - readme update
This commit is contained in:
parent
098ca9f97c
commit
994277affe
18
README.md
18
README.md
|
@ -105,15 +105,15 @@ In all FOC control modes, the controller features maximum motor speed and maximu
|
||||||
## Example Variants
|
## Example Variants
|
||||||
|
|
||||||
This firmware offers currently these variants (selectable in [platformio.ini](/platformio.ini) or [config.h](/Inc/config.h)):
|
This firmware offers currently these variants (selectable in [platformio.ini](/platformio.ini) or [config.h](/Inc/config.h)):
|
||||||
- **VARIANT_ADC**: In this variant the motors are controlled by two potentiometers connected to the Left sensor cable (long wired)
|
- **VARIANT_ADC**: The motors are controlled by two potentiometers connected to the Left sensor cable (long wired)
|
||||||
- **VARIANT_USART**: In this variant the motors are controlled via serial protocol (e.g. on USART3 right sensor cable, the short wired cable). The commands can be sent from an Arduino. Check out the [hoverserial.ino](/Arduino/hoverserial) as an example sketch.
|
- **VARIANT_USART**: The motors are controlled via serial protocol (e.g. on USART3 right sensor cable, the short wired cable). The commands can be sent from an Arduino. Check out the [hoverserial.ino](/Arduino/hoverserial) as an example sketch.
|
||||||
- **VARIANT_NUNCHUK**: Wii Nunchuk offers one hand control for throttle, braking and steering. This was one of the first input device used for electric armchairs or bottle crates.
|
- **VARIANT_NUNCHUK**: Wii Nunchuk offers one hand control for throttle, braking and steering. This was one of the first input device used for electric armchairs or bottle crates.
|
||||||
- **VARIANT_PPM**: This is when you want to use an RC remote control with PPM Sum signal.
|
- **VARIANT_PPM**: RC remote control with PPM Sum signal.
|
||||||
- **VARIANT_PWM**: This is when you want to use an RC remote control with PWM signal.
|
- **VARIANT_PWM**: RC remote control with PWM signal.
|
||||||
- **VARIANT_IBUS**: This is when you want to use an RC remote control with Flysky IBUS protocol connected to the Left sensor cable.
|
- **VARIANT_IBUS**: RC remote control with Flysky iBUS protocol connected to the Left sensor cable.
|
||||||
- **VARIANT_HOVERCAR**: In this variant the motors are controlled by two pedals brake and throttle. Reverse is engaged by double tapping on the brake pedal at standstill. See [HOVERCAR video](https://www.youtube.com/watch?v=IgHCcj0NgWQ&t=).
|
- **VARIANT_HOVERCAR**: The motors are controlled by two pedals brake and throttle. Reverse is engaged by double tapping on the brake pedal at standstill. See [HOVERCAR video](https://www.youtube.com/watch?v=IgHCcj0NgWQ&t=).
|
||||||
- **VARIANT_HOVERBOARD**: In this variant the mainboard reads the sideboards data. The sideboards need to be flashed with the hacked version. Only balancing controller is still to be implemented.
|
- **VARIANT_HOVERBOARD**: The mainboard reads the two sideboards data. The sideboards need to be flashed with the hacked version. The balancing controller is **not** yet implemented.
|
||||||
- **VARIANT_TRANSPOTTER**: This build is for transpotter which is a hoverboard based transportation system. For more details on how to build it check [here](https://github.com/NiklasFauth/hoverboard-firmware-hack/wiki/Build-Instruction:-TranspOtter) and [here](https://hackaday.io/project/161891-transpotter-ng).
|
- **VARIANT_TRANSPOTTER**: This is for transpotter build, which is a hoverboard based transportation system. For more details on how to build it check [here](https://github.com/NiklasFauth/hoverboard-firmware-hack/wiki/Build-Instruction:-TranspOtter) and [here](https://hackaday.io/project/161891-transpotter-ng).
|
||||||
- **VARIANT_SKATEBOARD**: This is for skateboard build, controlled using an RC remote with PWM signal connected to the right sensor cable.
|
- **VARIANT_SKATEBOARD**: This is for skateboard build, controlled using an RC remote with PWM signal connected to the right sensor cable.
|
||||||
|
|
||||||
Of course the firmware can be further customized for other needs or projects.
|
Of course the firmware can be further customized for other needs or projects.
|
||||||
|
@ -209,8 +209,8 @@ The errors reported by the board are in the form of audible beeps:
|
||||||
- **3 beeps (low pitch)**: Serial communication timeout
|
- **3 beeps (low pitch)**: Serial communication timeout
|
||||||
- **4 beeps (low pitch)**: General timeout (PPM, PWM, Nunchuck)
|
- **4 beeps (low pitch)**: General timeout (PPM, PWM, Nunchuck)
|
||||||
- **5 beeps (low pitch)**: Mainboard temperature warning
|
- **5 beeps (low pitch)**: Mainboard temperature warning
|
||||||
- **1 beep fast (medium pitch)**: Low battery voltage < 35V
|
|
||||||
- **1 beep slow (medium pitch)**: Low battery voltage < 36V
|
- **1 beep slow (medium pitch)**: Low battery voltage < 36V
|
||||||
|
- **1 beep fast (medium pitch)**: Low battery voltage < 35V
|
||||||
- **1 beep fast (high pitch)**: Backward spinning motors
|
- **1 beep fast (high pitch)**: Backward spinning motors
|
||||||
|
|
||||||
|
|
||||||
|
|
20
Src/util.c
20
Src/util.c
|
@ -370,26 +370,29 @@ void UART_DisableRxErrors(UART_HandleTypeDef *huart)
|
||||||
/* =========================== General Functions =========================== */
|
/* =========================== General Functions =========================== */
|
||||||
|
|
||||||
void poweronMelody(void) {
|
void poweronMelody(void) {
|
||||||
for (int i = 8; i >= 0; i--) {
|
buzzerCount = 0; // prevent interraction with beep counter
|
||||||
buzzerFreq = (uint8_t)i;
|
for (int i = 8; i >= 0; i--) {
|
||||||
HAL_Delay(100);
|
buzzerFreq = (uint8_t)i;
|
||||||
}
|
HAL_Delay(100);
|
||||||
buzzerFreq = 0;
|
}
|
||||||
|
buzzerFreq = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void beepCount(uint8_t cnt, uint8_t freq, uint8_t pattern) {
|
void beepCount(uint8_t cnt, uint8_t freq, uint8_t pattern) {
|
||||||
buzzerCount = cnt;
|
buzzerCount = cnt;
|
||||||
buzzerFreq = freq;
|
buzzerFreq = freq;
|
||||||
buzzerPattern = pattern;
|
buzzerPattern = pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
void beepLong(uint8_t freq) {
|
void beepLong(uint8_t freq) {
|
||||||
|
buzzerCount = 0; // prevent interraction with beep counter
|
||||||
buzzerFreq = freq;
|
buzzerFreq = freq;
|
||||||
HAL_Delay(500);
|
HAL_Delay(500);
|
||||||
buzzerFreq = 0;
|
buzzerFreq = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void beepShort(uint8_t freq) {
|
void beepShort(uint8_t freq) {
|
||||||
|
buzzerCount = 0; // prevent interraction with beep counter
|
||||||
buzzerFreq = freq;
|
buzzerFreq = freq;
|
||||||
HAL_Delay(100);
|
HAL_Delay(100);
|
||||||
buzzerFreq = 0;
|
buzzerFreq = 0;
|
||||||
|
@ -758,6 +761,7 @@ void cruiseControl(uint8_t button) {
|
||||||
void poweroff(void) {
|
void poweroff(void) {
|
||||||
enable = 0;
|
enable = 0;
|
||||||
consoleLog("-- Motors disabled --\r\n");
|
consoleLog("-- Motors disabled --\r\n");
|
||||||
|
buzzerCount = 0; // prevent interraction with beep counter
|
||||||
buzzerPattern = 0;
|
buzzerPattern = 0;
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
buzzerFreq = (uint8_t)i;
|
buzzerFreq = (uint8_t)i;
|
||||||
|
|
Loading…
Reference in New Issue