Salve a tutti, usando Leonardo ho creato un semplicissimo bottone che riproduce la barra spaziatrice della tastiera, testato e funzionante su 4 diversi pc, al 5 (quello importante) non va, il codice è questo:
const int buttonPin = 2; // input pin for pushbutton
int previousButtonState = HIGH; // for checking the state of a pushButton
void setup() {
// make the pushButton pin an input:
pinMode(buttonPin, INPUT);
// initialize control over the keyboard:
Keyboard.begin();
}
void loop() {
// read the pushbutton:
int buttonState = digitalRead(buttonPin);
// if the button state has changed,
if ((buttonState != previousButtonState)
// and it's currently pressed:
&& (buttonState == HIGH)) {
// type out a message
Keyboard.press(32);
delay(300);
Keyboard.releaseALL();
}
// save the current button state for comparison next time:
previousButtonState = buttonState;
}
l'unica differenza è che in quel pc non sono installate tastiere ed è presente uno schermo touchscreen, riesco a caricare il codice dall software di arduino collegato a quella macchina ma non succede nulla alla pressione del tasto, cosa potrebbe essere?