;D 8)
Hi there,
what fun is programming, yeeh ha!!
OK, i´m normal now. I did get help from a friend who is a good programmer.
He showed me some functions:
I can MIOS_MIDI_TxBufferPut(0xC1), I mean send Prg-Change,
I can light up the right led, in connection with a pushed button,
I can display “Programm 1-8” on the LCD,
I can merge midi in to out with MIOS_MIDI_MergerSet(0x01)
I´m really happy right now, this little box is working fine and it was quite easy.
So i am waiting for the parts now but the programming part is done!
The Box will have 8 Prg Change Buttons with Status LEDs, 2 Buttons for future functions, 1 Panic Button (Controller 123), and maybe a lcd display.
But i have one more question, is it possible to display e.g. Programm 1,2,… a bigger type, i mean over 2 lines of the 2x20 display instead of a 8 digit display?
Greetings
macsurfer4 (micha)
So here is some code, if you want please do some advices:
/////////////////////////////////////////////////////////////////////////////
// This function is called by MIOS when an button has been toggled
// pin_value is 1 when button released, and 0 when button pressed
/////////////////////////////////////////////////////////////////////////////
void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) __wparam
{
if(pin_value == 0 && pin <= 8)
{
// send program change status byte
MIOS_MIDI_TxBufferPut(0xC1);
// send program number
MIOS_MIDI_TxBufferPut(pin);
// switch all leds off
MIOS_DOUT_PinSet0(0);
MIOS_DOUT_PinSet0(1);
MIOS_DOUT_PinSet0(2);
MIOS_DOUT_PinSet0(3);
MIOS_DOUT_PinSet0(4);
MIOS_DOUT_PinSet0(5);
MIOS_DOUT_PinSet0(6);
MIOS_DOUT_PinSet0(7);
// switch pressed led on
MIOS_DOUT_PinSet1(pin);
//diplay Program number
MIOS_LCD_Clear();
MIOS_LCD_CursorSet(0x00);
MIOS_LCD_PrintCString(“Program”);
MIOS_LCD_PrintBCD3(pin+1);
}
else if(pin_value == 0 && pin == 11)
{
// send controller status byte
MIOS_MIDI_TxBufferPut(0xB1);
// send controller number
MIOS_MIDI_TxBufferPut(0x7B);
MIOS_MIDI_TxBufferPut(0x00);
}
}
and one more for the merger
/////////////////////////////////////////////////////////////////////////////
// This function is called by MIOS after startup to initialize the
// application
/////////////////////////////////////////////////////////////////////////////
void Init(void) __wparam
{
// set shift register update frequency
MIOS_SRIO_UpdateFrqSet(1); // ms
// we need to set at least one IO shift register pair
MIOS_SRIO_NumberSet(16); // for 128 pins
// debouncing value for DINs
MIOS_SRIO_DebounceSet(10);
//set midi merger on
MIOS_MIDI_MergerSet(0x01);
}