Outils pour utilisateurs

Outils du site


start:arduino:mains

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
start:arduino:mains [2023/01/27 16:08] – modification externe 127.0.0.1start:arduino:mains [2023/04/13 07:23] (Version actuelle) – [Programme HackBerry_Test_tinkercad.ino version V1.0] gerardadmin
Ligne 20: Ligne 20:
  
 [[https://wikifab.org/wiki/Proth%C3%A8se_de_main_command%C3%A9e_par_des_capteurs_musculaires#%C3%89tape_32_-_T%C3%A9l%C3%A9verser_le_code_Arduino_dans_la_main|Prothese main robot Arduino]] [[https://wikifab.org/wiki/Proth%C3%A8se_de_main_command%C3%A9e_par_des_capteurs_musculaires#%C3%89tape_32_-_T%C3%A9l%C3%A9verser_le_code_Arduino_dans_la_main|Prothese main robot Arduino]]
 +
 +[[https://wikilab.myhumankit.org/index.php?title=Projets:Bionicohand#R.C3.A9f.C3.A9rences.2F_Sources|Bionicohan FR]]
  
  
Ligne 31: Ligne 33:
  
 [[https://youtu.be/J7_LEoYuqww|video  capteur EMG EN]] [[https://youtu.be/J7_LEoYuqww|video  capteur EMG EN]]
 +
 +
 +[[start:arduino:emg|test capteurs EMG]]
  
  
Ligne 595: Ligne 600:
 } }
 </code> </code>
 +
 +==== Test main.ino====
 +<code c testmain.ino>
 +//EMG sensor robotic hand controller 
 +//This code is for controlling a robotic hand with
 +//an EMG sensor. 
 +//
 +//© Au Robots 8.4.2017
 +
 +
 +//Necessary for controlling the servos
 +#include <Servo.h> 
 +
 +const int x = ///// This is the reference value and it
 +//will depend on your setup. You have to find it out 
 +//yourself by looking at the serial monitor and finding
 +//a value between the maximum and minimum value.
 +
 +//Naming the servos
 +Servo servo1;
 +Servo servo2;
 +Servo servo3;
 +Servo servo4;
 +Servo servo5;
 +Servo servo6;
 +
 +void setup() 
 +
 +//Starting the serial monitor
 +Serial.begin(9600); 
 +
 +//Configuring servo pins
 +servo2.attach(10); // pinky
 +servo3.attach(11); //ring
 +servo4.attach(3); // middle
 +servo5.attach(6); //index
 +servo6.attach(5); //thumb
 +
 +
 +
 +void loop() 
 +
 +//Printing the EMG data
 +Serial.println(analogRead(5)); 
 +
 +//If the EMG data is greater than x the hand closes
 +  if(analogRead(5) > x) {
 +    servo2.write(180);
 +    servo3.write(148);
 +    servo4.write(89);
 +    servo5.write(180);
 +    servo6.write(180);
 +  }
 +
 +//If the EMG data is lower than x the hand opens
 +  else if (analogRead(5) < x) {
 +    servo2.write(38);
 +    servo3.write(10);
 +    servo4.write(0);
 +    servo5.write(16);
 +    servo6.write(16);
 +  }
 +
 +//A delay to slow down the process
 +  delay(100);
 +
 +</code>
 +
/home/chanteri/www/fablab37110/data/attic/start/arduino/mains.1674832098.txt.gz · Dernière modification : 2023/01/27 16:08 de 127.0.0.1