Skip to content

Commit

Permalink
Firmware: map inputs to pins in hardware design
Browse files Browse the repository at this point in the history
  • Loading branch information
michd committed Jun 2, 2023
1 parent e560035 commit 8199f1c
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions firmware/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
#include <stdint.h>
#include <Arduino.h>

#define PIN_MIDI_SOURCE_A 27
#define PIN_MIDI_SOURCE_B 26
#define PIN_MIDI_SOURCE_C 22
// Mapping as per rev0 of the PCB
#define PIN_MIDI_SOURCE_1 16
#define PIN_MIDI_SOURCE_2 17
#define PIN_MIDI_SOURCE_3 21
#define PIN_MIDI_SOURCE_4 28
#define PIN_MIDI_SOURCE_5 5
#define PIN_MIDI_SOURCE_6 10
#define PIN_MIDI_SOURCE_7 14
#define PIN_MIDI_SOURCE_8 15

#define PIN_MIDI_SINK_TX 8
#define PIN_MIDI_SINK_RX 9
Expand All @@ -17,9 +23,14 @@ MidiMerger* merger;

void setup() {
merger = new MidiMerger(new MidiSink(uart1, PIN_MIDI_SINK_TX, PIN_MIDI_SINK_RX));
merger->addSource(new MidiSource(PIN_MIDI_SOURCE_A));
merger->addSource(new MidiSource(PIN_MIDI_SOURCE_B));
merger->addSource(new MidiSource(PIN_MIDI_SOURCE_C));
merger->addSource(new MidiSource(PIN_MIDI_SOURCE_1));
merger->addSource(new MidiSource(PIN_MIDI_SOURCE_2));
merger->addSource(new MidiSource(PIN_MIDI_SOURCE_3));
merger->addSource(new MidiSource(PIN_MIDI_SOURCE_4));
merger->addSource(new MidiSource(PIN_MIDI_SOURCE_5));
merger->addSource(new MidiSource(PIN_MIDI_SOURCE_6));
merger->addSource(new MidiSource(PIN_MIDI_SOURCE_7));
merger->addSource(new MidiSource(PIN_MIDI_SOURCE_8));
}

void loop() {
Expand Down

0 comments on commit 8199f1c

Please sign in to comment.