Click here to Skip to main content
15,896,269 members
Articles / Programming Languages / C

Arduino-Based MIDI Expression Pedal

Rate me:
Please Sign up or sign in to vote.
4.99/5 (46 votes)
17 Jul 2009CPOL10 min read 162.2K   807   49  
Create a MIDI expression pedal with an Arduino circuit board
// Raw potentiometer value viewer

// Constants
#include "WProgram.h"
void setup();
void loop();
const int POT_PIN = 0;                  // Pot connected to analog pin 0
const int SERIAL_PORT_RATE = 9600;


void setup()                            // Run once, when the sketch starts
{
    Serial.begin(SERIAL_PORT_RATE);     // Starts communication with the MIDI out port
}

void loop()                             // Run over and over again
{
    int nValue = analogRead(POT_PIN);
    Serial.println(nValue);
}

int main(void)
{
	init();

	setup();
    
	for (;;)
		loop();
        
	return 0;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
In a nutshell, my forte is Windows, Macintosh, and cross-platform development, and my interests are in UI, image processing, and MIDI application development.

Comments and Discussions