Hi there.
I am trying to make a handbrake work on PS4. I have tested my arduino pro micro and the hall pass sensor (magnetic) with the below code which works on PC fine but i now need to change it to a keyboard press so the playstation will think when pulling the hand brake its pushing a key on the keyboard any help would be appreciated please.
#include <Joystick.h>
Joystick_ Joystick;
int zAxis_ = 0;
void setup() {
Joystick.begin();
}
void loop() {
zAxis_ = analogRead(A2);
Joystick.setZAxis(zAxis_);
Serial.println(zAxis_);
delay(20);
}
This one dosnt work it constantly puts Q's up and wont stop
#include <Keyboard.h>
void setup()
{pinMode(A2, INPUT); }
const int pinToButtonMap = A2;
void loop()
{int pot = analogRead(A2);
int mapped = map(pot,0,1023,0,255);
while (analogRead(A2) == HIGH) {}
Keyboard.press("Q");
Keyboard.releaseAll();
delay(200);
while (analogRead(A2) == LOW) {}
}