Différences

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

Lien vers cette vue comparative

Prochaine révision
Révision précédente
Prochaine révisionLes deux révisions suivantes
contribs:usbcollective [2017/04/10 14:03] – créée cbellotcontribs:usbcollective [2017/04/17 17:16] cbellot
Ligne 36: Ligne 36:
 {{:contribs:img_7093.jpg?400|}} {{:contribs:img_7093.jpg?400|}}
  
 +Programme :
 +<code c>
 +#include <Bounce.h>
 +
 +Bounce button0 = Bounce(0, 10);  // 10 ms debounce time
 +Bounce button1 = Bounce(1, 10);
 +Bounce button2 = Bounce(2, 10);
 +Bounce button3 = Bounce(3, 10);
 +Bounce button4 = Bounce(4, 10);
 +Bounce button5 = Bounce(5, 10);
 +Bounce button6 = Bounce(6, 10);
 +Bounce button7 = Bounce(7, 10);
 +
 +void setup() {
 +  pinMode(0, INPUT_PULLUP);
 +  pinMode(1, INPUT_PULLUP);
 +  pinMode(2, INPUT_PULLUP);
 +  pinMode(3, INPUT_PULLUP);
 +  pinMode(4, INPUT_PULLUP);
 +  pinMode(5, INPUT_PULLUP);
 +  pinMode(6, INPUT_PULLUP);
 +  pinMode(7, INPUT_PULLUP);
 +}
 +void loop() {
 +  Joystick.Z(analogRead(0)); // collectif
 +  Joystick.Zrotate(analogRead(1)); // potentiomètre de manche
 +  Joystick.X(analogRead(2)); // mini stick X
 +  Joystick.Y(analogRead(3)); // mini stick Y
 +
 +  button0.update();
 +  button1.update();
 +  button2.update();
 +  button3.update();
 +  button4.update();
 +  button5.update();
 +  button6.update();
 +  button7.update();
 +
 +  if (button0.fallingEdge()) {
 +    Joystick.button(1, 1);
 +  }
 +  if (button1.fallingEdge()) {
 +    Joystick.button(2, 1);
 +  }
 +  if (button2.fallingEdge()) {
 +    Joystick.button(3, 1);
 +  }
 +  if (button3.fallingEdge()) {
 +    Joystick.button(4, 1);
 +  }
 +  if (button4.fallingEdge()) {
 +    Joystick.button(5, 1);
 +  }
 +  if (button5.fallingEdge()) {
 +    Joystick.button(6, 1);
 +  }
 +  if (button6.fallingEdge()) {
 +    Joystick.button(7, 1);
 +  }
 +  if (button7.fallingEdge()) {
 +    Joystick.button(8, 1);
 +  }
 +
 +  if (button0.risingEdge()) {
 +    Joystick.button(1, 0);
 +  }
 +  if (button1.risingEdge()) {
 +    Joystick.button(2, 0);
 +  }
 +  if (button2.risingEdge()) {
 +    Joystick.button(3, 0);
 +  }
 +  if (button3.risingEdge()) {
 +    Joystick.button(4, 0);
 +  }
 +  if (button4.risingEdge()) {
 +    Joystick.button(5, 0);
 +  }
 +  if (button5.risingEdge()) {
 +    Joystick.button(6, 0);
 +  }
 +  if (button6.risingEdge()) {
 +    Joystick.button(7, 0);
 +  }
 +  if (button7.risingEdge()) {
 +    Joystick.button(8, 0);
 +  }
 +
 +  delay(50);
 +}
 +</code>
 ===== Montage et soudures ===== ===== Montage et soudures =====
  
 {{:contribs:img_7120.jpg?400|}} {{:contribs:img_7120.jpg?400|}}
  
-===== Montage terminé =====+===== Montage de test terminé =====
  
 {{:contribs:img_7121.jpg?400|}} {{:contribs:img_7121.jpg?400|}}
 {{:contribs:img_7122.jpg?400|}} {{:contribs:img_7122.jpg?400|}}
 {{:contribs:img_7123.jpg?400|}} {{:contribs:img_7123.jpg?400|}}
 +
 +===== Système de fixation sur le siège =====
 +
 +{{:contribs:collectifusba1.jpg?400|}}
 +{{:contribs:collectifusba2.jpg?400|}}
 +{{:contribs:collectifusba3.jpg?400|}}
 +
 +===== Montage sur le siège =====
 +{{:contribs:collectifusba4.jpg?400|}}
 
contribs/usbcollective.txt · Dernière modification : 2017/05/01 09:59 de cbellot