Difference between revisions of "Microduino-Joypad Getting start"
From Microduino Wiki
Line 52: | Line 52: | ||
*步骤八:你可以打开电源开关,观察供电是否正常。 | *步骤八:你可以打开电源开关,观察供电是否正常。 | ||
[[File:Microduino_Joypad_switch-2.jpg||600px|center|thumb]] | [[File:Microduino_Joypad_switch-2.jpg||600px|center|thumb]] | ||
+ | |||
+ | *如果要安装Microduino-Joypad-Game板,你需要把右边的摇杆取下来 | ||
+ | |||
+ | [[File:Microduino_Joypad_keyboard_1.jpg||600px|center|thumb]] | ||
+ | |||
+ | *将面板上的按键接口和底板接口通过线连接起来 | ||
+ | [[File:Microduino_Joypad_keyboard_2.jpg||600px|center|thumb]] | ||
+ | *再用螺丝将面板固定住。 | ||
+ | [[File:Microduino_Joypad_keyboard_3.jpg||600px|center|thumb]] | ||
==测试== | ==测试== |
Revision as of 11:29, 19 November 2014
测试
程序说明
//光照----------------------
Joypad.readLightSensor();
//麦克风--------------------
Joypad.readMicrophone();
//INTA----------------------
Joypad.readIntA();
//INTB----------------------
Joypad.readIntB();
//左模拟摇杆----------------
Joypad.readJoystickX();
Joypad.readJoystickY();
//右模拟摇杆----------------
Joypad.readJoystick1X();
Joypad.readJoystick1Y();
Joypad.readButton(byte ch);
//左模拟摇杆----------------
JOYSTICK_UP;
JOYSTICK_DOWN;
JOYSTICK_LEFT;
JOYSTICK_RIGHT;
//左模拟摇杆按下------------
CH_JOYSTICK_SW
//右模拟摇杆----------------
JOYSTICK1_UP;
JOYSTICK1_DOWN;
JOYSTICK1_LEFT;
JOYSTICK1_RIGHT;
//右模拟摇杆按下------------
CH_JOYSTICK1_SW
//拨档开关------------------
CH_SWITCH_L;
CH_SWITCH_R;
//四组按键------------------
CH_SWITCH_1;
CH_SWITCH_2;
CH_SWITCH_3;
CH_SWITCH_4;
//==========================
//蜂鸣器---------------------
Joypad.tone(unsigned int freq);
Joypad.tone(unsigned int freq, unsigned long duration);
Joypad.noTone();
//振动------------------------
Joypad.motor(unsigned int motor_vol);
“unsigned int motor_vol”:振动强弱 开始应用 |