is there a way / a driver to access a MAX72xx under MIOS32? I know there is a MAX72xx driver in the svn in the MIOS8 path, but none for MIOS32.
The reason I’m asking is that I have a midibox’ed Tascam MMRC (with a few MAX7219), and i’d like to put a LPC17 (USB, Ethernet..) in there instead of my Pic Core.
some more questions about the MAX72xx driver, this time on MIOS8 with a PIC-Core.
** First of all I must say that I’m a totally newbie when it comes to programming. I’ve managed to get my Tascam up and running (buttons and button matrix, some single leds..), but addressing LEDs with the MAX-driver is way over my head.**
So, what I’m basicially looking for is a simply way to turn LEDs on and off via note on/off events.
If I want to control LEDs directly connected to DOUTs I use the “MIOS_DOUT_PinSet” function. Is there some kind of equivalent in the MAX72xx driver?
I messed around with the stribe project a bit, and I guess the “STRIBE_SetDot” function is what I’m looking for, but there are some problems: a) there is only one LED at a time lit, as soon as I press another note the first LEDs turns off, and b) there are three MAX7219, and I don’t know how to address each chip separately.
So before digging around in the stribe code too much, is there a simple way to use LEDs via MAX7219s by just using the driver (without any stribe stuff)?
I soldered 7221 on the board (was SMD but not as tough as I thought) and now I can access every single led.
At first I left the DINs in parallel as they were before, and the behavior was exactly the same as with the 7219, but when I changed to a DIN>DOUT chain it worked. Mapping is still a bit weird (have to access stribe numbers 0,1,2 & 3, but I only have three 7221 at all), but anyway…
has anyone an idea how to implement a “delay” or “lag” function for LEDs?
Background:
My Tascam Remote now “speaks” the Mackie protocol, and I want to make use of the signal LEDs found on the original hardware. According to the manual the host software sends midi channel pressure commands which turn on the signal LED for about 300ms.
So, what i basically need is a function which turns the LED off after a period of time (without receiving any other midi message).
Right now I have something like this:
/////////////////////////////////////////////////////////////////////////////
// This function is called by MIOS when a complete MIDI event has been received
/////////////////////////////////////////////////////////////////////////////
void MPROC_NotifyReceivedEvnt(unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam
{
if( evnt0 == 0xD0 && evnt1 >= 0x01 && evnt1 <= 0x0C ) // receive Channel pressure for Ch.1
{ STRIBE_SetLED(2, 2, 0x37, 1); // turns on LED
????; // some delay function... ???
STRIBE_SetLED(2, 2, 0x37, 0); // turns off LED
}
}
I read some thread about people using SR_Service_Prepare to do that but I guess in my case this wouldn’t work because all my LEDs are connected via MAX7221. I also fooled around with the MIOS_Delay but it didn’t work. I guess I must use Timer or Tick but I have no clue how to do that.
a timer (see mios32_timer tutorial) which decrements these counters as long as they are > 0 - it could be called each mS.
Note that there is already a function which is called each mS which you could re-use for such a purpose: APP_SR_Service_Prepare()!
a task which periodically updates the MAX7221 whenever the state of a LED has changed.
This task should also set LEDs as long as the appr. counters are 0
your MIDI receiver sets a counter to 300 -> the timer will decrement the counter each mS, your task will notify this and update the LED accordingly.