MIDI cc

I have gone through numerous sketches to get a working one. I am using an Arduino micro. One potentiometer is attached to A0, GND and 5V. All I need is for this to send the midi via the usb port on the board.
Many of the sketches have uploaded correctly and Windows see the device, but neither the software or MIDIOX is receiving any midi messages. The pot will be in an expression pedal so the message should be 0 to 127. I have watched tutorials, looked at other posts and sketches but cannot get it programmed correctly. I am at the point that I just need to give up trying hit or miss. I'm sure this is simple for someone that knows how to do this, so if there is a person that can do it, may I PLEASE have the code?

Are You using the USB into the Pc? Have You tried using the Arduino IDE and serial channel to verify the hardware link?
Windows see the device? What does it appear as?

Post some code you have that "have uploaded correctly and Windows see the device". Then explain what problems it has and "someone who knows how to do this" can help you fix it.

If you've already got that close there's not much chance of someone wanting to start again and write you a new program from scratch. That's asking a bit too much.

Steve

This should work:

Pieter

I copied the script from that site. Is this the entire script? If so, when compiling, I get an error MIDI_Controller: No such file or directory. I added library- #include <Controller.h> and removed yours, then I got an error-- Analog does not name a type

#include <MIDI_Controller.h> // Include the library

// Create a new instance of the class 'Analog', called 'potentiometer', on pin A0,
// that sends MIDI messages with controller 7 (channel volume) on channel 1
Analog potentiometer(A0, MIDI_CC::Channel_Volume, 1);

void setup() {}

void loop() {
// Refresh the MIDI controller (check whether the potentiometer's input has changed since last time, if so, send the new value over MIDI)
MIDI_Controller.refresh();
}

from_pieter:11:55: error: MIDI_Controller.h: No such file or directory

compilation terminated.

exit status 1
MIDI_Controller.h: No such file or directory

You have to install the library. Please see the home page of that GitHub repo I linked to.

MIDI Controller

Finally got a working sketch. Thank you