Cambio Sequenziale con Arduino

membri italiani - Nota del traduttore in alto a destra di Google

Cambio Sequenziale con Arduino

Postby EliaC » Fri 29. Dec 2017, 13:37

Salve, ho comprato da poco un thrustmaster t300rs ed ho pensato di costruire un cambio sequenziale con la stampante 3d utilizzando un progetto trovato su thingiverse
Il problema è il seguente quando vado ad eseguire il codice con Arduino:
// Simple example application that shows how to read four Arduino
// digital pins and map them to the USB Joystick library.
//
// Ground digital pins 9, 10, 11, and 12 to press the joystick
// buttons 0, 1, 2, and 3.
//
// NOTE: This sketch file is for use with Arduino Leonardo and
// Arduino Micro only.
//
// by Matthew Heironimus
// 2015-11-20
//--------------------------------------------------------------------

#include <Joystick.h>

Joystick_ Joystick;

void setup() {
// Initialize Button Pins
pinMode(9, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);

// Initialize Joystick Library
Joystick.begin();
}

// Constant that maps the phyical pin to the joystick button.
const int pinToButtonMap = 9;

// Last state of the button
int lastButtonState[4] = {0,0,0,0};

void loop() {

// Read pin values
for (int index = 0; index < 4; index++)
{
int currentButtonState = !digitalRead(index + pinToButtonMap);
if (currentButtonState != lastButtonState[index])
{
Joystick.setButton(index, currentButtonState);
lastButtonState[index] = currentButtonState;
}
}

delay(50);
}


per scriverlo sulla scheda mi da il seguente problema
Users/eliacardinali/Documents/Arduino/joystick/joystick.ino:14:22: fatal error: Joystick.h: No such file or directory
#include <Joystick.h>
^
compilation terminated.
exit status 1
Errore durante la compilazione per la scheda Arduino Leonardo.
Non avendo conoscenze nel campo della programmazione tantomeno di Arduino non so come risolvere; ringrazio in anticipo chiunque mi aiuterà!!
EliaC
 
Posts: 1
Joined: Fri 29. Dec 2017, 13:25
Has thanked: 0 time
Been thanked: 0 time

Return to Italy forum

Who is online

Users browsing this forum: No registered users and 7 guests