Show Posts
Pages: [1]
1  International / Français / Re: simuler un clavier avec arduino on: July 17, 2011, 03:29:18 pm
je reviens ici apres un long moment d abscense, mais j ai reussi a faire ce que je voulais :
recupere les commandes au volant dans la clio 2, un carpc est installé dedans

voici comment j ai procédé :

voici le montage :
http://www.flickr.com/photos/65310522@N02/5947194889/in/set-72157627217130720

Les A? et B? correspondent au commande au volant, je me suis branché directement dessus, les fils arrivant deriere l autoradio n etant pas les bons

pour a1 a2 b1 b2 b3 voir ici : http://www.forum-clio.com/index.php/topic,800.0.html

voila le code arduino : http://pastebin.com/fk71UXy8

ensuite j ai installer AACKEYS ( http://www.aacinstitute.org/Resources/ProductsandServices/AACKeys/AACKeys.html )
qui restranscrit ce qui recoit sur le port serial en touche du clavier, par exemple la carte arduino envoi au pc "a", on  aura simulé un appui sur la touche "a"
je n ai pas reussi a faire envoyer des combinaisons de touches mais ca marche comme ca et ca me convient   mais si quelqu un y arrive je suis prenneur

ensuite j utilise centrafuse ( un logiciel pour carpc ) qui prend en compte les raccourci clavier,
OU
avec autohotkey, un petit exemple :



e::
Send {Media_Next}
return

z::
Send {Volume_Up 1}
return

a::
Send {Volume_Down 1}
return



c est la maniere la plus simple que j ai trouvé pour communiquer de l arduino vers le pc  smiley
2  Using Arduino / Storage / Re: arduino mega + sd card connected with resistor on: March 27, 2011, 07:04:17 am
the code is here :
le library is on this post : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/0

Code:
#include <sd-reader_config.h>
#include <sd_raw.h>
#include <sd_raw_config.h>





int print_disk_info();
int sample();
int readDisk();

byte incomingByte;
void printWelcome();
long int address;
byte tempBytes[2];


void setup()
{

  Serial.begin(9600);
  delay(1000);

  printWelcome();
  if(!sd_raw_init())
  {
     Serial.println("MMC/SD initialization failed");
  }
  print_disk_info();
}



void loop()
{
    int i;

    if(Serial.available()>0)
    {
       incomingByte=Serial.read();

     switch(incomingByte)
     {
         case 114:
               readDisk();
               break;
         case 115:
               sample();
               break;
         default:
               break;
     }
    }
}

int sample()
{
    int i,j;
    int temp;
    byte low;
    byte high;
    byte inByte;

    Serial.println();
    Serial.println();
    Serial.println("Sampling..");
    for(i=0;i<500;i=i+2)
    {
      if(Serial.available()>0)
      {
        inByte=Serial.read();
        if(inByte==113) return 0;
      }
      temp=analogRead(0);
      Serial.print(temp,DEC);
      Serial.print(" ");

      //Convert int to 2 bytes
      low=temp&0xFF;
      high=temp>>8;
     // Serial.print(temp,DEC);
      //Serial.print(low,DEC);
      //Serial.print(high,DEC);

      tempBytes[0]=low;
      tempBytes[1]=high;

      if(!sd_raw_write(i,tempBytes,2))
      {
        Serial.print("Write error");
      }
      //sd_raw_sync();
      delay(5000);

  Serial.println();

    }

    return 1;
}


int readDisk()
{
    byte low;
    byte high;
    byte info[2];
    int i;
    int  result;
    Serial.println();
    for(i=0;i<50;i=i+2)
    {
      sd_raw_read(i,info,2);

      //Serial.print(info[0],DEC);
      //Serial.print(" ");
      //Serial.print(info[1],DEC);
      low=info[0];
      high=info[1];
      result=high<<8;
      //result<<8;
      Serial.print(" ");
      Serial.print(result+low,DEC);
      Serial.print(" ");
    }

}

void printWelcome()
{
    Serial.println("------------------------");
    Serial.println("Data sampling system");
    Serial.println("send r to read disk");
    Serial.println("send s to start sampling");
    Serial.println("send q to stop sampling");
    Serial.println("Ready.....");
    Serial.println("-------------------------");
}


int print_disk_info()
{


    struct sd_raw_info disk_info;
    if(!sd_raw_get_info(&disk_info))
    {
      return 0;
    }


    Serial.println();
    Serial.print("rev:    ");
    Serial.print(disk_info.revision,HEX);
    Serial.println();
    Serial.print("serial: 0x");
    Serial.print(disk_info.serial,HEX);
    Serial.println();
    Serial.print("date:   ");
    Serial.print(disk_info.manufacturing_month,DEC);
    Serial.println();
    Serial.print(disk_info.manufacturing_year,DEC);
    Serial.println();
    Serial.print("size:   ");
    Serial.print(disk_info.capacity,DEC);
    Serial.println();
    Serial.print("copy:   ");
    Serial.print(disk_info.flag_copy,DEC);
    Serial.println();
    Serial.print("wr.pr.: ");
    Serial.print(disk_info.flag_write_protect_temp,DEC);
    Serial.print('/');
    Serial.print(disk_info.flag_write_protect,DEC);
    Serial.println();
    Serial.print("format: ");
    Serial.print(disk_info.format,DEC);
    Serial.println();
    Serial.print("free:   ");

    return 1;
}




3  Using Arduino / Storage / arduino mega + sd card connected with resistor on: March 25, 2011, 04:49:46 pm
hi,
i m try to write on my sd card connected with resistor to arduino
i try this : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/0
 
but i have may errors at compiling :
arduino sd card example.cpp:1:30: error: sd-reader_config.h: No such file or directory
arduino sd card example.cpp:2:20: error: sd_raw.h: No such file or directory
arduino sd card example.cpp:3:27: error: sd_raw_config.h: No such file or directory
arduino sd card example.cpp:13: error: 'byte' does not name a type
arduino sd card example.cpp:16: error: 'byte' does not name a type
arduino sd card example.cpp: In function 'void setup()':
arduino sd card example.cpp:22: error: 'Serial' was not declared in this scope
arduino sd card example.cpp:23: error: 'delay' was not declared in this scope
arduino sd card example.cpp:26: error: 'sd_raw_init' was not declared in this scope
arduino sd card example.cpp: In function 'void loop()':
arduino sd card example.cpp:39: error: 'Serial' was not declared in this scope
arduino sd card example.cpp:41: error: 'incomingByte' was not declared in this scope
arduino sd card example.cpp: In function 'int sample()':
arduino sd card example.cpp:61: error: 'byte' was not declared in this scope
arduino sd card example.cpp:61: error: expected `;' before 'low'
arduino sd card example.cpp:62: error: expected `;' before 'high'
arduino sd card example.cpp:63: error: expected `;' before 'inByte'
arduino sd card example.cpp:65: error: 'Serial' was not declared in this scope
arduino sd card example.cpp:72: error: 'inByte' was not declared in this scope
arduino sd card example.cpp:75: error: 'analogRead' was not declared in this scope
arduino sd card example.cpp:76: error: 'DEC' was not declared in this scope
arduino sd card example.cpp:80: error: 'low' was not declared in this scope
arduino sd card example.cpp:81: error: 'high' was not declared in this scope
arduino sd card example.cpp:86: error: 'tempBytes' was not declared in this scope
arduino sd card example.cpp:89: error: 'sd_raw_write' was not declared in this scope
arduino sd card example.cpp:94: error: 'delay' was not declared in this scope
arduino sd card example.cpp: In function 'int readDisk()':
arduino sd card example.cpp:106: error: 'byte' was not declared in this scope
arduino sd card example.cpp:106: error: expected `;' before 'low'
arduino sd card example.cpp:107: error: expected `;' before 'high'
arduino sd card example.cpp:108: error: expected `;' before 'info'
arduino sd card example.cpp:111: error: 'Serial' was not declared in this scope
arduino sd card example.cpp:114: error: 'info' was not declared in this scope
arduino sd card example.cpp:114: error: 'sd_raw_read' was not declared in this scope
arduino sd card example.cpp:119: error: 'low' was not declared in this scope
arduino sd card example.cpp:120: error: 'high' was not declared in this scope
arduino sd card example.cpp:124: error: 'DEC' was not declared in this scope
arduino sd card example.cpp: In function 'void printWelcome()':
arduino sd card example.cpp:132: error: 'Serial' was not declared in this scope
arduino sd card example.cpp: In function 'int print_disk_info()':
arduino sd card example.cpp:146: error: aggregate 'sd_raw_info disk_info' has incomplete type and cannot be defined
arduino sd card example.cpp:147: error: 'sd_raw_get_info' was not declared in this scope
arduino sd card example.cpp:153: error: 'Serial' was not declared in this scope
arduino sd card example.cpp:155: error: 'HEX' was not declared in this scope
arduino sd card example.cpp:161: error: 'DEC' was not declared in this scope


What does it mean?
I have copied the library SDcard in  libraries

my board is the mega 1280
4  International / Français / Re: simuler un clavier avec arduino on: February 03, 2011, 12:35:44 pm
alors, la transmission se fait de cette maniere  ;
start b7 b6 b5 b4 b3 b2 b1 b0 partié stop
sur une frequence comprise entre 10 et 20khz

comment envoyer un signal de ce type; avec port port serial ou digital ?
merci
5  International / Français / simuler un clavier avec arduino on: February 02, 2011, 09:37:46 am
bonjour smiley,
j aimerais simuler un clavier avec arduino vers l ordinateur
 j ai pensé a :
avec un port  serie ( de la carte arduino mega ) vers un port PS/2

d apres cette doc : http://www.networktechinc.com/ps2-prots.html

il suffirais d envoyer $E9 ( d apres un pdf ) pour faire un volume up

vu que le port ps/2 est un port serie un "serial2.write(11101001);" fonctionnerais ?

cette solution eviterais d avoir un logiciel en plus sur l ordinateur
merci

6  Forum 2005-2010 (read only) / Français / Re: arduino -> action sur le pc (serial ) on: January 19, 2011, 05:49:24 am
merci,
j ai trouvé ca : http://www.acraigie.com/programming/firmatavb/default.html
c est une interface entre arduino et vb.net, il me reste plus qu a apprendre le vb.net smiley-wink
7  Forum 2005-2010 (read only) / Français / Re: arduino -> action sur le pc (serial ) on: January 17, 2011, 02:21:29 pm
avec grider http://www.promixis.com/girder.php, il n y a pas moyen de faire quelque chose ?
il tranforme les signaux d entree ( rs232 ) en action sur le pc
8  Forum 2005-2010 (read only) / Français / Re: arduino -> action sur le pc (serial ) on: January 17, 2011, 02:09:41 pm
windows xp 32bits
9  Forum 2005-2010 (read only) / Français / arduino -> action sur le pc (serial ) on: January 17, 2011, 01:51:56 pm
bonjour,
coomment faire pour quand on envoi "vol up" ( par exemple ) de l'arduino au pc par le port serie/usb, le pc baisse le son ( ou n importe quelle action )

merci smiley
Pages: [1]