commit 50ae23cb00e10b79351622171e87bfc88a5e0872 from: Pavol Calfa date: Sat Jan 7 11:02:20 2023 UTC feat: Morse::gpio_set_wpm(uint8_t the_wpm) added to change WPM Morse::gpio_set_wpm(uint8_t the_wpm) allows to change the WPM for GPIO based Morse Code. commit - 57c98b0c044e33779bf41284e2d553355812a6e8 commit + 50ae23cb00e10b79351622171e87bfc88a5e0872 blob - 39f51736c51a55362d566435cf178f51d50e7482 blob + 435b77dd3bf360b5b8c84731ef742704ae1a1db3 --- Morse.cpp +++ Morse.cpp @@ -187,6 +187,13 @@ Morse::gpio_tx(String tx) } void +Morse::gpio_set_wpm(uint8_t the_wpm) { + gpio_wpm = the_wpm; + gpio_unit_t = UNIT_T(gpio_wpm); + gpio_inited = 1; +} + +void gpio_handle_chars(void) { gpio_tx_current_millis = millis(); blob - dc08d32c79a9603b5594b379560718e05b6ef2eb blob + fdaafea21a98533cc0b10b3ba8d2dc4808954a54 --- Morse.h +++ Morse.h @@ -36,6 +36,7 @@ Morse uint8_t gpio_transmitting(void); void gpio_tx(String tx); + void gpio_set_wpm(uint8_t the_wpm); void gpio_tx_stop(void); void gpio_watchdog(void); blob - 068bc11ac1d387e77d9ef175cf433f55f485d657 blob + d7e1680571efa3d68f0f2bbffaf68e444bb2a191 --- README.md +++ README.md @@ -42,6 +42,11 @@ To enable the Morse Code, two watchdogs are available: morse.gpio_watchdog(); morse_dac.dac_watchdog(); +To set the WPM for GPIO based Morse Code, use ```gpio_set_wpm``` function: + + morse.gpio_set_wpm(new_wpm) + + Example -------