#include <Wire.h>
#include <hd44780.h> // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header
//hd44780_I2Cexp lcd; // declare lcd object: auto locate & auto config expander chip
hd44780_I2Cexp lcd1(0x27);
hd44780_I2Cexp lcd2(0x26);
const int LCD_COLS = 16;
const int LCD_ROWS = 4;
#include <Control_Surface.h> // Include the Control Surface library
USBMIDI_Interface midi; // Instantiate a MIDI over USB interface.
// Instantiate an array of CCButton objects that send MIDI control
// change messages whenever the button is pressed/released
CCButton buttons[] {
{0, 85}, // button pin number, controller number
{1, 86},
{2, 87},
{3, 88},
{4, 89},
{8, 90},
{9, 91},
{10, 92},
};
// Create an array of CCValueLED objects that turn on/off an LED
// depending on the MIDI control change messages they receive
CCValueLED leds[] {
{11, 85}, // led pin number, controller number
{12, 86},
{13, 87},
{14, 88},
{15, 89},
{16, 90},
{17, 91},
{18, 92},
};
// Instantiate a CCPotentiometer object
CCPotentiometer potentiometer[] = {
{A0,0x10}, // Analog pin connected to potentiometer
{MIDI_CC::Channel_Volume, CHANNEL_1}, // Channel volume of channel 1
{A1,0x11},
{MIDI_CC::Channel_Volume, CHANNEL_1}, // Channel volume of channel 1
{A2,0x12},
{MIDI_CC::Channel_Volume, CHANNEL_1}, // Channel volume of channel 1
};
void setup() {
Control_Surface.begin(); // Initialize Control Surface
int status;
// initialize LCD with number of columns and rows:
// hd44780 returns a status from begin() that can be used
// to determine if initalization failed.
// the actual status codes are defined in <hd44780.h>
// See the values RV_XXXX
//
// looking at the return status from begin() is optional
// it is being done here to provide feedback should there be an issue
//
// note:
// begin() will automatically turn on the backlight
//
status = lcd1.begin(LCD_COLS, LCD_ROWS);
status = lcd2.begin(LCD_COLS, LCD_ROWS);
//if(status) // non zero status means it was unsuccesful
{
// hd44780 has a fatalError() routine that blinks an led if possible
// begin() failed so blink error code using the onboard LED if possible
//hd44780::fatalError(status); // does not return
}
// initalization was successful, the backlight should be on now
// Print a message to the LCD
lcd2.print("CHORUS PHASER DELAY 1 DELAY 2");
lcd1.print("FLANGER TREMOLO OD CW Filter");
}
void loop() {
Control_Surface.loop(); // Update the Control Surface
}