update 2
I want to make a program that can play sound (that can say red, green and blue) on my pic 18f4550 there is a speaker connected to the picdem, that part works fine, I wrote the following program with microchip version 6.83 with the C compiler.
I need to retrieve the bits value of a .wav file, when I say red (this has a bit pattern). My right question, how can a get the bit value of my .wav file.
void main (void)
{
TRISD = 0x00; // PORTD als uitgang
TRISB = 0b00110000; // RB4 en RB5 als ingang
TRISA = 0x00; // RA output
RCONbits.IPEN = 0; // interrupts
INTCONbits.GIE = 1;
INTCONbits.RBIE = 1;
while(1)
{
_asm sleep _endasm
}
}
#pragma interrupt ISR
void ISR (void)
{
int red[] = {bit values off sound red???};
int blue[] = {bit values off sound green???};
int green[] = {bit values off sound blue???};
if (INTCONbits.RBIF==1)
{
if(PORTBbits.RB5==0) // S3 pressed?
{
int i = 0;
int b;
do {
LATAbits.LATA2 = rood[i];
LATDbits.LATD1 ^= 1;
b = 0;
//do-while voor de frequentie (1500 is de freq)
do {
b++;
}while(b <= 2000);
i++;
}while(rood[i] <= 50);
//LATDbits.LATD1 ^= 1; // D2 togglen
}
}
INTCONbits.RBIF = 0;
}