Difference between revisions of "Microduino-Joypad Getting start"
From Microduino Wiki
(→测试) |
|||
Line 104: | Line 104: | ||
***360度最大幅度旋转两个摇杆,看TFT屏上数据没变化即可按下B按键,进入测试模式。 | ***360度最大幅度旋转两个摇杆,看TFT屏上数据没变化即可按下B按键,进入测试模式。 | ||
− | [[File:Microduino_Joypad_Remote2.jpg||600px|center|thumb]] | + | [[File:Microduino_Joypad_Remote2.jpg||600px|center|thumb]] |
****你可以拨动开关或者摇动摇杆来观察界面变化,同时四组按键可控制蜂鸣器发声,摇杆按钮可控制Joypad最大幅度振动。 | ****你可以拨动开关或者摇动摇杆来观察界面变化,同时四组按键可控制蜂鸣器发声,摇杆按钮可控制Joypad最大幅度振动。 | ||
+ | |} |
Revision as of 03:48, 21 October 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”:振动强弱 测试
|