Difference between revisions of "Microduino-Joypad Getting start"
From Microduino Wiki
(correct github link) |
|||
Line 77: | Line 77: | ||
*Libraries needed: | *Libraries needed: | ||
**https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Libraries | **https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Libraries | ||
− | You will need | + | You will need _01_Microduino_TFT_ST7735 and _08_Microduino_Shield_Joypad library. |
*Debugging: | *Debugging: | ||
**Hardware needed: Microduino-USBTTL, Microduino-Core and the equipped Microduino-Joypad | **Hardware needed: Microduino-USBTTL, Microduino-Core and the equipped Microduino-Joypad |
Revision as of 19:10, 4 December 2014
Test
You will need _01_Microduino_TFT_ST7735 and _08_Microduino_Shield_Joypad library.
Program Description
//Left analog joystick----------------
Joypad.readJoystickX();
Joypad.readJoystickY();
//Right analog joystick----------------
Joypad.readJoystick1X();
Joypad.readJoystick1Y();
Joypad.readButton(byte ch);
//Left analog joystick----------------
JOYSTICK_UP;
JOYSTICK_DOWN;
JOYSTICK_LEFT;
JOYSTICK_RIGHT;
//Left analog joystick press------------
CH_JOYSTICK_SW
//Right analog joystick----------------
JOYSTICK1_UP;
JOYSTICK1_DOWN;
JOYSTICK1_LEFT;
JOYSTICK1_RIGHT;
//Right analog joystick press ------------
CH_JOYSTICK1_SW
//Switch ------------------
CH_SWITCH_L;
CH_SWITCH_R;
//Four groups of buttons------------------
CH_SWITCH_1;
CH_SWITCH_2;
CH_SWITCH_3;
CH_SWITCH_4;
//==========================
//Buzzer---------------------
Joypad.tone(unsigned int freq);
Joypad.tone(unsigned int freq, unsigned long duration);
Joypad.noTone();
//Vibration------------------------
Joypad.motor(unsigned int motor_vol);
“unsigned int motor_vol”:Vibration intensity Start Application |