Hallo,
Nach paar tagen suche im netz und verschiedenen Foren bin ich nun auf dieses Gestoßen.
Mein Vorhaben
Ich habe nen Arduino Uno und möchte mit diesem gerne eine art Tastatur bauen für einige Spiele wie den LS15 zum Beispiel,
Ich habe 6 Taster angeschlossen und programmiert, soweit klappt da auch alles am seriellen monitor bekomme ich auch eine gute ausgabe finde ich, nur mein problem,
Wie schreibe ich in AutoIT ein Tool, womit ich unter Windows 7 die Taster nutzen kann ?
Hier ist mein Arduino code:
Java
#include <Bounce.h>
/*
Pin Belegungen
B1 = 2
b2 = 4
b3 = 7
b4 = 8
b5 = 12
b6 = 13
*/
const int buttonPin1 = 2;
const int buttonPin2 = 4;
const int buttonPin3 = 7;
const int buttonPin4 = 8;
const int buttonPin5 = 12;
const int buttonPin6 = 13;
Bounce deb_buttonPin1 = Bounce(buttonPin1, 10);
Bounce deb_buttonPin2 = Bounce(buttonPin2, 10);
Bounce deb_buttonPin3 = Bounce(buttonPin3, 10);
Bounce deb_buttonPin4 = Bounce(buttonPin4, 10);
Bounce deb_buttonPin5 = Bounce(buttonPin5, 10);
Bounce deb_buttonPin6 = Bounce(buttonPin6, 10);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(buttonPin1,INPUT_PULLUP);
pinMode(buttonPin2,INPUT_PULLUP);
pinMode(buttonPin3,INPUT_PULLUP);
pinMode(buttonPin4,INPUT_PULLUP);
pinMode(buttonPin5,INPUT_PULLUP);
pinMode(buttonPin6,INPUT_PULLUP);
}
void loop() {
if (deb_buttonPin1.update() || deb_buttonPin2.update() || deb_buttonPin3.update() || deb_buttonPin4.update() || deb_buttonPin5.update() || deb_buttonPin6.update())
{
if (deb_buttonPin1.risingEdge())
{
if(digitalRead(buttonPin1) == LOW)
{
Serial.println("W");
}
}
if (deb_buttonPin2.risingEdge())
{
if(digitalRead(buttonPin2) == LOW)
{
Serial.println("A");
}
}
if (deb_buttonPin3.risingEdge())
{
if(digitalRead(buttonPin3) == LOW)
{
Serial.println("S");
}
}
if (deb_buttonPin4.risingEdge())
{
if(digitalRead(buttonPin4) == LOW)
{
Serial.println("D");
}
}
if (deb_buttonPin5.risingEdge())
{
if(digitalRead(buttonPin5) == LOW)
{
Serial.println("F");
}
}
if (deb_buttonPin6.risingEdge())
{
if(digitalRead(buttonPin6) == LOW)
{
Serial.println("G");
}
}
}
}
Alles anzeigen
Kann mir jemand so ein Tool eventuell basteln wenn es nicht zu viel Arbeit ist ? oder einen kleinen Anstoß geben wie ich dies Selbst machen kann ??
Danke schonmal im Vorraus :=)
MFG
De_Kerwer