Difference between revisions of "Microduino-Joypad Getting start"
From Microduino Wiki
Line 4: | Line 4: | ||
===硬件搭建=== | ===硬件搭建=== | ||
*材料清单 | *材料清单 | ||
+ | 遥控器我们采用Microduino-Joypad来实现,当然,你还需要其他模块才能把遥控器搭建起来。 | ||
+ | ===所需设备=== | ||
+ | *所需Microduino模块 | ||
+ | {|class="wikitable" | ||
+ | |- | ||
+ | |模块||数量||功能 | ||
+ | |- | ||
+ | |[[Microduino-Joypad/zh]] ||1||遥控器 | ||
+ | |- | ||
+ | |[[Microduino-Core/zh ]]||1||核心板 | ||
+ | |- | ||
+ | |[[Microduino-USBTTL/zh]]||1||下载程序 | ||
+ | |} | ||
+ | *其他设备 | ||
+ | {|class="wikitable" | ||
+ | |- | ||
+ | |模块||数量||功能 | ||
+ | |- | ||
+ | | USB数据线|| 1||数据传输 | ||
+ | |- | ||
+ | | 电池盒 || 1||装载电池 | ||
+ | |- | ||
+ | | 7号干电池||3 ||提供电源 | ||
+ | |} | ||
+ | |||
[[File:Microduino_Joypad_TFT-all.jpg||600px|center|thumb]] | [[File:Microduino_Joypad_TFT-all.jpg||600px|center|thumb]] | ||
Revision as of 16:26, 15 November 2014
硬件搭建
遥控器我们采用Microduino-Joypad来实现,当然,你还需要其他模块才能把遥控器搭建起来。 所需设备
测试
程序说明
//光照----------------------
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”:振动强弱 开始应用 |