Page d'interface de la carte audio linux

joris Abadiejoris Abadie

Interface pinguino pour les PIC18F4550 pour linux

code pour pinguino


// code sous Pinguino pour la carte audio linux 
// joris andre ABADIE 2012 copie left GNU

int dac1;
int dac2;
int dac3;
int dac4;
int dac5;
int dac6;
int dac7;
int dac8;
int dac9;
int dac10;
int dac11;
int dac12;
int dac13;
int dac14;
int dac15;
int dac16;
int forme1;
int forme2;
int forme3;
int forme4;
int forme5;
int forme6;
int forme7;
int forme8;

void setup()
{

//debut adressage des sorties induit par le routage sur la carte

        dac1=37;
        dac2=40;
        dac3=38;
        dac4=39;
        dac5=33;
        dac6=36;
        dac7=34;
        dac8=35;
        dac9=27;
        dac10=30;
        dac11=28;
        dac12=29;
        dac13=20;
        dac14=22;
        dac15=19;
        dac16=21;
        forme1=2;
        forme2=3;
        forme3=4;
        forme4=5;
        forme5=6;
        forme6=7;
        forme7=8;
        forme8=9;

//fin adressage des sorties
        pinMode(dac1,OUTPUT);
        pinMode(dac2,OUTPUT);
        pinMode(dac3,OUTPUT);
        pinMode(dac4,OUTPUT);
        pinMode(dac5,OUTPUT);
        pinMode(dac6,OUTPUT);
        pinMode(dac7,OUTPUT);
        pinMode(dac8,OUTPUT);
        pinMode(dac9,OUTPUT);
        pinMode(dac10,OUTPUT);
        pinMode(dac11,OUTPUT);
        pinMode(dac12,OUTPUT);
        pinMode(dac13,OUTPUT);
        pinMode(dac14,OUTPUT);
        pinMode(dac15,OUTPUT);
        pinMode(dac16,OUTPUT);
        pinMode(forme1,OUTPUT);
        pinMode(forme2,OUTPUT);
        pinMode(forme3,OUTPUT);
        pinMode(forme4,OUTPUT);
        pinMode(forme5,OUTPUT);
        pinMode(forme6,OUTPUT);
        pinMode(forme7,OUTPUT);
        pinMode(forme8,OUTPUT);

     digitalWrite(dac1,LOW);   
     digitalWrite(dac2,LOW);   
     digitalWrite(dac3,LOW);   
     digitalWrite(dac4,LOW);   
     digitalWrite(dac5,LOW);   
     digitalWrite(dac6,LOW);   
     digitalWrite(dac7,LOW);   
     digitalWrite(dac8,LOW);   
     digitalWrite(dac9,LOW);   
     digitalWrite(dac10,LOW);
     digitalWrite(dac11,LOW);   
     digitalWrite(dac12,LOW);   
     digitalWrite(dac13,LOW);   
     digitalWrite(dac14,LOW);   
     digitalWrite(dac15,LOW);   
     digitalWrite(dac16,LOW);

     digitalWrite(forme1,LOW);   
     digitalWrite(forme2,LOW);   
     digitalWrite(forme3,LOW);   
     digitalWrite(forme4,LOW);   
     digitalWrite(forme5,LOW);   
     digitalWrite(forme6,LOW);   
     digitalWrite(forme7,LOW);   
     digitalWrite(forme8,LOW);   

Serial.begin(9600);  // mise en place du dialogue PC carte et de sa vitesse 

}

 
void loop(){
if (Serial.available())
    {
    if (Serial.read()=='A') digitalWrite(dac1,HIGH);  // de A a P DAC monte
    if (Serial.read()=='B') digitalWrite(dac2,HIGH);   
    if (Serial.read()=='C') digitalWrite(dac3,HIGH);   
    if (Serial.read()=='D') digitalWrite(dac4,HIGH);   
    if (Serial.read()=='E') digitalWrite(dac5,HIGH);   
    if (Serial.read()=='F') digitalWrite(dac6,HIGH);   
    if (Serial.read()=='G') digitalWrite(dac7,HIGH);   
    if (Serial.read()=='H') digitalWrite(dac8,HIGH);   
    if (Serial.read()=='I') digitalWrite(dac9,HIGH);   
    if (Serial.read()=='J') digitalWrite(dac10,HIGH);  
    if (Serial.read()=='K') digitalWrite(dac11,HIGH);   
    if (Serial.read()=='L') digitalWrite(dac12,HIGH);   
    if (Serial.read()=='M') digitalWrite(dac13,HIGH);   
    if (Serial.read()=='N') digitalWrite(dac14,HIGH);   
    if (Serial.read()=='O') digitalWrite(dac15,HIGH);   
    if (Serial.read()=='p') digitalWrite(dac16,HIGH);   

    if (Serial.read()=='Q') digitalWrite(dac1,LOW); // de Q a 6 DAC descend
    if (Serial.read()=='R') digitalWrite(dac2,LOW);   
    if (Serial.read()=='S') digitalWrite(dac3,LOW);   
    if (Serial.read()=='T') digitalWrite(dac4,LOW);   
    if (Serial.read()=='U') digitalWrite(dac5,LOW);   
    if (Serial.read()=='V') digitalWrite(dac6,LOW);   
    if (Serial.read()=='W') digitalWrite(dac7,LOW);   
    if (Serial.read()=='X') digitalWrite(dac8,LOW);   
    if (Serial.read()=='Y') digitalWrite(dac9,LOW);   
    if (Serial.read()=='Z') digitalWrite(dac10,LOW);
    if (Serial.read()=='1') digitalWrite(dac11,LOW);   
    if (Serial.read()=='2') digitalWrite(dac12,LOW);   
    if (Serial.read()=='3') digitalWrite(dac13,LOW);   
    if (Serial.read()=='4') digitalWrite(dac14,LOW);   
    if (Serial.read()=='5') digitalWrite(dac15,LOW);   
    if (Serial.read()=='6') digitalWrite(dac16,LOW);

    if (Serial.read()=='10') digitalWrite(forme1,HIGH);  // de 10 a 17 monte les resistances du CRC
    if (Serial.read()=='11') digitalWrite(forme2,HIGH);   
    if (Serial.read()=='12') digitalWrite(forme3,HIGH);   
    if (Serial.read()=='13') digitalWrite(forme4,HIGH);   
    if (Serial.read()=='14') digitalWrite(forme5,HIGH);   
    if (Serial.read()=='15') digitalWrite(forme6,HIGH);   
    if (Serial.read()=='16') digitalWrite(forme7,HIGH);   
    if (Serial.read()=='17') digitalWrite(forme8,HIGH);   

    if (Serial.read()=='20') digitalWrite(forme1,LOW);  // de 20 a 27 descend les resistances du CRC
    if (Serial.read()=='21') digitalWrite(forme2,LOW);   
    if (Serial.read()=='22') digitalWrite(forme3,LOW);   
    if (Serial.read()=='23') digitalWrite(forme4,LOW);   
    if (Serial.read()=='24') digitalWrite(forme5,LOW);   
    if (Serial.read()=='25') digitalWrite(forme6,LOW);   
    if (Serial.read()=='26') digitalWrite(forme7,LOW);   
    if (Serial.read()=='27') digitalWrite(forme8,LOW);   

    }



}

Interface IOIO pour android

Interface pour casque neural