Hello, I´m trying to understand some parts of this program.
I´m beginning with programming and I can´t figure out why the * in the end of this variable, is this a variable at all ??? :o
Joystick* joystick;
And I´m aswell a bit confused with this part.
else if (move == Joystick::Move::RIGHT)
would some one kindly help me thanks a lot in advance.
here is the full code I wrote. I kind of understand my complete code just hanging at those 2 parts
#include <AxisJoystick.h> //Joystick Bibliothek
#include <IRremote.h> //IR Bibliothek
//Konstanten deklarieren
const uint8_t SW_PIN = 2;
const uint8_t VRX_PIN = A1;
const uint8_t VRY_PIN = A2;
//Bibliothek Abhängig
Joystick* joystick;
IRsend irsend;
void setup() {
Serial.begin(9600); //Debug only
//Joystick = Axisjoystick
joystick = new AxisJoystick(SW_PIN, VRX_PIN, VRY_PIN);
}
void loop() {
//Position Joystick aufrufen
Position(joystick->multipleRead());
delay (100);
}
String Position(const Joystick::Move move) {
static int standby = 0;
if (move == Joystick::Move::NOT && standby == 1) {
//Neutral Code 3x Senden
for (int i = 0; i < 2 ; i++) {
irsend.sendNEC(0xA2EAA1, 32); //Send Neutral code
delay (50);
Serial.println ("Neutral");
}
standby = 0;
delay (100);
}
//Gang
else if (move == Joystick::Move::PRESS) {
irsend.sendNEC(0xFF02FD, 32); //Send Gear code
standby = 1;
delay (100);
Serial.println("Gang");
}
//Vor
else if (move == Joystick::Move::UP) {
irsend.sendNEC(0xFF629D, 32); //send UP code
standby = 1;
Serial.println("Zurück");
delay (100);
}
//Zurück
else if (move == Joystick::Move::DOWN) {
irsend.sendNEC(0xFFA857, 32); //Send DOWN code
standby = 1;
Serial.println ("Vor");
delay (100);
}
//Rechts
else if (move == Joystick::Move::RIGHT) {
irsend.sendNEC(0xFFC23D, 32); //Send RIGHT code
standby = 1;
Serial.println ("Links");
delay (100);
}
//Links
else if (move == Joystick::Move::LEFT) {
irsend.sendNEC(0xFF22DD, 32); //Send LEFT code,
standby = 1;
Serial.println ("Rechts");
delay(100);
}
else {
}
}
/*
int x;
void f2()
{
int x = 1; // hide global x
::x = 2; // assign to global x
x = 2; // assign to local x
// ...
} */