changement de port série et ajout de commentaires
This commit is contained in:
parent
d636811c2b
commit
233762dd1a
@ -74,9 +74,9 @@ int RegistreC = 0xFF ; /* initialisation registre C */
|
|||||||
int RegistreL = 0xFF ; /* initialisation registre L */
|
int RegistreL = 0xFF ; /* initialisation registre L */
|
||||||
|
|
||||||
|
|
||||||
|
/* variable pour l'utilisation du port A */
|
||||||
|
|
||||||
|
int EPA0 = B00000001 ; /* Etat A0 du Port A */
|
||||||
int EPA0 = B00000001 ; /* variable pour l'utilisation du port A */
|
|
||||||
int EPA1 = B00000010 ; //
|
int EPA1 = B00000010 ; //
|
||||||
int EPA2 = B00000100 ; //
|
int EPA2 = B00000100 ; //
|
||||||
int EPA3 = B00001000 ; //
|
int EPA3 = B00001000 ; //
|
||||||
@ -85,7 +85,7 @@ int EPA5 = B00100000 ; //
|
|||||||
int EPA6 = B01000000 ; //
|
int EPA6 = B01000000 ; //
|
||||||
int EPA7 = B10000000 ; //
|
int EPA7 = B10000000 ; //
|
||||||
|
|
||||||
int DePA0 = 1 ; //
|
int DePA0 = 1 ; /* Dernier etat de A0 du port A */ //
|
||||||
int DePA1 = 2 ; //
|
int DePA1 = 2 ; //
|
||||||
int DePA2 = 4 ; //
|
int DePA2 = 4 ; //
|
||||||
int DePA3 = 8 ; //
|
int DePA3 = 8 ; //
|
||||||
@ -221,17 +221,16 @@ void setup()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Serial.begin(31250); /* initialisation d'un port serie au debit MIDI */
|
Serial2.begin(31250); /* initialisation du port serie 2 broche 16 au debit MIDI */
|
||||||
|
|
||||||
for (int i=0x24 ; i<= 0x43 ; i++ )
|
for (int i=0x24 ; i<= 0x43 ; i++ ) /* boucle de mise d'extinction des notes */
|
||||||
{
|
{
|
||||||
noteOn( 0x80, i , 0x00 ) ;
|
noteOn( 0x80, i , 0x00 ) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
delay(2000);
|
delay(2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*EXEMPLE INITIAL
|
||||||
|
|
||||||
void noteOn(int cmd, int pitch, int velocity) /* plays a MIDI note. Doesn't check to see that cmd is greater than 127,
|
void noteOn(int cmd, int pitch, int velocity) /* plays a MIDI note. Doesn't check to see that cmd is greater than 127,
|
||||||
or that data values are less than 127 */
|
or that data values are less than 127 */
|
||||||
@ -266,7 +265,7 @@ void loop()
|
|||||||
EPA6 = RegistreA & Masque64 ;
|
EPA6 = RegistreA & Masque64 ;
|
||||||
EPA7 = RegistreA & Masque128 ;
|
EPA7 = RegistreA & Masque128 ;
|
||||||
|
|
||||||
if ( ( EPA0 == 0 ) && ( DePA0 == 1 ) ) { noteOn(0x90, 0x24 , 0x90 ) ; }
|
if ( ( EPA0 == 0 ) && ( DePA0 == 1 ) ) { noteOn(0x90, 0x24 , 0x90 ) ; } /* si etat A0=0 et Dernier etat A0=1 , jouer la note */
|
||||||
if ( ( EPA0 == 1 ) && ( DePA0 == 0 ) ) { noteOn(0x80, 0x24 , 0x00 ) ;}
|
if ( ( EPA0 == 1 ) && ( DePA0 == 0 ) ) { noteOn(0x80, 0x24 , 0x00 ) ;}
|
||||||
|
|
||||||
if ( ( EPA1 == 0 ) && ( DePA1 == Masque2 ) ) {noteOn(0x90, 0x25 , 0x70 ) ;}
|
if ( ( EPA1 == 0 ) && ( DePA1 == Masque2 ) ) {noteOn(0x90, 0x25 , 0x70 ) ;}
|
||||||
@ -397,10 +396,8 @@ void loop()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* port A */
|
||||||
|
DePA0 = EPA0 ; /* Dernier etat = etat : réinitialisation des etats avant rebouclage et lecture */
|
||||||
|
|
||||||
DePA0 = EPA0 ; /* port A */
|
|
||||||
DePA1 = EPA1 ;
|
DePA1 = EPA1 ;
|
||||||
DePA2 = EPA2 ;
|
DePA2 = EPA2 ;
|
||||||
DePA3 = EPA3 ;
|
DePA3 = EPA3 ;
|
||||||
@ -448,6 +445,3 @@ void loop()
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user