Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
2.First-Input.ino

2.First-Input

This is the second example used in the 'Getting Started' guide: https://tttapa.github.io/Control-Surface/Doxygen/d5/d7d/md_pages_Getting-Started.html

Boards: 🛈
AVR, AVR USB, Nano Every, Due, Nano 33 IoT, Nano 33 BLE, UNO R4, Pi Pico, Teensy 3.x, ESP32, ESP8266

Written by PieterP, 2018-08-29
https://github.com/tttapa/Control-Surface

// Include the library
// Instantiate a MIDI Interface to use
// Instantiate a shift register as output for the LEDs
SPI, // SPI interface to use
10, // Latch pin (ST_CP)
MSBFIRST, // Byte order
};
// Create an array of LEDs that listen to MIDI Note messages, turning on and off
// the LEDs connected to the eight output pins of the shift register
NoteLED leds[] {
{sreg.pin(0), MIDI_Notes::C[4]}, // LED pin, address (note number, channel, cable)
{sreg.pin(1), MIDI_Notes::D[4]}, //
{sreg.pin(2), MIDI_Notes::E[4]}, //
{sreg.pin(3), MIDI_Notes::F[4]}, //
{sreg.pin(4), MIDI_Notes::G[4]}, //
{sreg.pin(5), MIDI_Notes::A[4]}, //
{sreg.pin(6), MIDI_Notes::B[4]}, //
{sreg.pin(7), MIDI_Notes::C[5]}, //
};
// Initialize the Control Surface
void setup() {
Control_Surface.begin();
}
// Update the Control Surface
void loop() {
}
The main header file that includes all Control-Surface header files.
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
pin_t pin(pin_int_t pin) const
Get the extended IO pin number of a given physical pin of this extended IO element.
A class for serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bu...
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
NoteCCKPLED< MIDIMessageType::NoteOn > NoteLED
Class that listens for MIDI Note events on a single address and turns on an LED when the value is hig...
constexpr Note F
F (Fa).
Definition Notes.hpp:61
constexpr Note G
G (Sol).
Definition Notes.hpp:63
constexpr Note E
E (Mi).
Definition Notes.hpp:60
constexpr Note B
B (Si).
Definition Notes.hpp:67
constexpr Note A
A (La).
Definition Notes.hpp:65
constexpr Note C
C (Do).
Definition Notes.hpp:56
constexpr Note D
D (Re).
Definition Notes.hpp:58