display support added
This commit is contained in:
parent
12a7cb3d85
commit
64b6f6fbd8
6 changed files with 258 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "bsp/board.h"
|
||||
#include "hardware/adc.h"
|
||||
#include "pico/binary_info/code.h"
|
||||
#include "pico/multicore.h"
|
||||
#include "pico/stdlib.h"
|
||||
#include "pico/util/queue.h"
|
||||
|
@ -10,10 +11,11 @@
|
|||
|
||||
#include "keyer.h"
|
||||
#include "settings.h"
|
||||
#include <config.h>
|
||||
#include "tm1637.h"
|
||||
#include "tusb_config.h"
|
||||
#include "utils.h"
|
||||
#include "winkeyer.h"
|
||||
#include <config.h>
|
||||
|
||||
extern const uint LED_PIN = PICO_DEFAULT_LED_PIN;
|
||||
extern const uint LEFT_PADDLE_PIN = 14;
|
||||
|
@ -22,6 +24,8 @@ extern const uint BUZZER_PIN = 18;
|
|||
extern const uint CW_OUT_PIN = 17;
|
||||
// extern const uint AUDIO_OUT_PIN = 16;
|
||||
extern const uint ADC_PIN = 26;
|
||||
const uint DISPLAY_DIO_PIN = 20;
|
||||
const uint DISPLAY_CLK_PIN = 21;
|
||||
|
||||
queue_t keyerQueue;
|
||||
|
||||
|
@ -120,6 +124,13 @@ int main()
|
|||
|
||||
WinKeyer winKeyer;
|
||||
|
||||
pio_hw_t *pio = pio0;
|
||||
TM1637 display {DISPLAY_DIO_PIN, DISPLAY_CLK_PIN, pio};
|
||||
bi_decl(bi_1pin_with_name(DISPLAY_DIO_PIN, "[DIO] LED segments data pin"));
|
||||
bi_decl(bi_1pin_with_name(DISPLAY_CLK_PIN, "[CLK] LED segments clock pin"));
|
||||
display.displayIambicMode(settings.mode);
|
||||
//display.displaySpeed(11);
|
||||
|
||||
while (true) {
|
||||
currentWpm = calcWPM(potiRead(), settings.wpmPotiMin, settings.wpmPotiMax);
|
||||
|
||||
|
@ -129,6 +140,8 @@ int main()
|
|||
queue_add_blocking(&keyerQueue, &keyerQueueData);
|
||||
printf("WPM has changed to: %d\n", currentWpm);
|
||||
lastWpm = currentWpm;
|
||||
display.displaySpeed(currentWpm);
|
||||
|
||||
}
|
||||
|
||||
tud_task(); // Internal PICO purposes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue