Dear Thorsten
Since I first sent this message I realise that I dont need pointers for a character array. I realise that I only need single quotation marks and dont need the *. However it should still work.
Here is the modified code. I still get the same errors during compilation!
void AIN_NotifyChange(unsigned char pot, unsigned int pin_value) __wparam
{
//Send Midi Control to Sound Module eg B1 08 XX, B0 0B YY etc
unsigned char status[8] = {'B1', 'B1', 'B1', 'B0', 'B0', 'B0', 'B2', 'B1'};
unsigned char byte[8] = {'0x08', '0x0B', '0x09', '0x0B', '0x07', '0x08', '0x0B', '0x01'};
if( pot >= 0 && pot <=7 ){
MIOS_MIDI_TxBufferPut(status);
MIOS_MIDI_TxBufferPut(byte);
MIOS_MIDI_TxBufferPut(pin_value);}
}
Orig Message I have managed to program on Core 2 the two keyboards complete with:- A) one Unmuxed Analog channel generating B1 07 XX B) 2 X 61 keynotes with upper keyboard wired backwards to minimise DIN - DIN cabling C) Coupling of the two keyboards (Double Note On/Off Messages. Thanks very much for your input. 8 Unmuxed Analog Inputs I am attempting to write the code for Core 1 Analog inputs, these are balance controls and Tremelo speed pots. There are 8 pots. I have proved that the system will generate Midi Control Changes but not in the required manner. As you will see below I am attempting to construct a character array pointer with two variables (status) and (byte). These correspond to the 1st and 2nd bytes of the midi message. The compilation does not work, I get character incompatibilty problems. (see below). I am showing the two sections concerned with AIN inputs.
/////////////////////////////////////////////////////////////////////////////
// This function is called by MIOS after startup to initialize the
// application
/////////////////////////////////////////////////////////////////////////////
void Init(void) __wparam
{
// initialize the shift registers
MIOS_SRIO_NumberSet(16); // shiftregisters
MIOS_SRIO_UpdateFrqSet(1); // mS
MIOS_AIN_NumberSet (8); // number of pots
MIOS_AIN_UnMuxed ;
//define deadband, use 7
MIOS_AIN_DeadbandSet (7);
}
/////////////////////////////////////////////////////////////////////////////
// This function is called by MIOS when a pot has been moved
/////////////////////////////////////////////////////////////////////////////
void AIN_NotifyChange(unsigned char pot, unsigned int pin_value) __wparam
{
//Send Midi Control to Sound Module eg B1 08 XX, B0 0B YY etc
unsigned char * status[8] = {"B1", "B1", "B1", "B0", "B0", "B0", "B2", "B1"};
unsigned char * byte[8] = {"0x08", "0x0B", "0x09", "0x0B", "0x07", "0x08", "0x0B", "0x01"};
if( pot >= 0 && pot <=7 ){
MIOS_MIDI_TxBufferPut(status);
MIOS_MIDI_TxBufferPut(byte);
MIOS_MIDI_TxBufferPut(pin_value);}
}
[u]Compiler text[/u]
C:\C_Stops>make
Makefile generated.
Makefile.bat generated.
Directory already exists
Assembling MIOS SDCC wrapper
==========================================================================
Compiling pic18f452.c
Processor: 18F452
==========================================================================
Compiling main.c
Processor: 18F452
main.c:238: error 78: incompatible types
from type 'unsigned-char generic* [8] '
to type 'unsigned-char'
main.c:239: error 78: incompatible types
from type 'unsigned-char generic* [8] '
to type 'unsigned-char'
-:0: error 103: code not generated for 'AIN_NotifyChange' due to previous errors
ERROR!
Please note that I am trying the’ Hex’ 0xB1 and ‘straight’ B1 data. Both give the same error.
Please help.
Best Regards Robin