Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: use true private variables in code example #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GeorgianStan
Copy link

The TS access modifier private is removed in detriment of true private
variables.
Use the same code for PointAnimationComponent class to fix wrong
variable names that were used when the document was translated for
other languages.

The TS access modifier `private` is removed in detriment of true private
variables.
Use the same code for `PointAnimationComponent` class to fix wrong
variable names that were used when the document was translated for
other languages.
@GeorgianStan
Copy link
Author

Hi @mgechev. Did you have time to review the PR?

@chevette17
Copy link

#include <Joystick.h>

// Create the Joystick
Joystick_ Joystick;

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

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

//Initialise USB !IMPORTANT!
USB_Begin();

// Initialize Joystick Library
Joystick.begin();

}

// Last state of the button
int lastButtonState = 0;

void loop() {

// Read pin values
int currentButtonState = !digitalRead(pinToButtonMap);
if (currentButtonState != lastButtonState)
{
Joystick.setButton(0, currentButtonState);
lastButtonState = currentButtonState;
}

delay(50);

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants