So would it be right to connect the like:
Yes that and the code is fine.
Control Change.
1011nnnn
0ccccccc
0vvvvvvvThis message is sent when a controller value changes. Controllers include devices such as pedals and levers. Controller numbers 120-127 are reserved as "Channel Mode Messages" (below). (ccccccc) is the controller number (0-119). (vvvvvvv) is the controller value (0-127).
So to send a controller change on channel 1 to controller 80 (decimal?) with a value of on:-
MIDI_TX(0xb0, 80, 127);
and for off:-
MIDI_TX(0xb0, 80, 0);