Skip to content

Commit

Permalink
More comments example #66
Browse files Browse the repository at this point in the history
  • Loading branch information
tttapa committed Nov 27, 2019
1 parent 519612b commit ce3e956
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@
// Encoder must be included before Control Surface
#include <Control_Surface.h>

// MIDI Interface to use
USBMIDI_Interface midi;

// Bank with 120 settings in total, increments of 1 address at a time
Bank<120> bank = {1};

// A rotary encoder to select one of the 120 bank settings
EncoderSelector<120> selector = {
bank, // bank to manage
{2, 3}, // encoder pins
4, // encoder pulses per step
Wrap::Clamp, // clamp or wrap around when going beyond maximum/minimum setting
};

// The potentiometer that sends MIDI messages
// the address (controller number) depends on the bank setting
Bankable::CCPotentiometer potentiometer = {
{bank, BankType::CHANGE_ADDRESS}, // Bank configuration
A0, // Analog pin for potentiometer
Expand Down
9 changes: 9 additions & 0 deletions examples/examples.h
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,15 @@
* <https://github.com/tttapa/Control-Surface/issues/40>
*/

/**
* @example "Encoder-Selector-Bank.ino"
*
* Encoder-Selector-Bank
* =====================
*
* https://github.com/tttapa/Control-Surface/issues/66
*/

/**
* @example "MIDI-Input-Callback.ino"
*
Expand Down

0 comments on commit ce3e956

Please sign in to comment.