Pots to midi with hairless

I want to send some data from the pots to my serial port and in the sketch create something to let this value to be seen as midi values (or something that the program can see). I can't figure out what kind of code I've to create..