“Microduino-Joypad Getting start”的版本间的差异

来自Microduino Wikipedia
跳转至: 导航搜索
 
(未显示4个用户的14个中间版本)
第1行: 第1行:
 +
{{Language|Microduino-Joypad Getting start}}
 
{| style="width: 800px;"
 
{| style="width: 800px;"
 
|-
 
|-
 
|
 
|
===硬件搭建===
+
*Microduino modules needed 
*步骤一:将Microduino-TFT安装在Microduino-Joypad面板上;
+
{|class="wikitable"
 +
|-
 +
|Module||Number||Function
 +
|-
 +
|[[Microduino-Joypad]] ||1||Remote controller 
 +
|-
 +
|[[Microduino-Core ]]||1||Core board 
 +
|-
 +
|[[Microduino-USBTTL]]||1||Program download
 +
|}
 +
*Other Equipment 
 +
{|class="wikitable"
 +
|-
 +
|Module||Number||Function
 +
|-
 +
| USB cable|| 1||Data transmission
 +
|-
 +
| Battery box || 1||Battery load
 +
|-
 +
|7th battery ||3 ||Power supply
 +
|}
 +
 
 +
[[File:Microduino_Joypad_TFT-all.jpg||600px|center|thumb]]
 +
 
 +
*Step 1: Install Microduino-TFT on the panel of Microduino-Joypad; 
 
[[File:Microduino_Joypad_TFT-1.jpg||600px|center|thumb]]
 
[[File:Microduino_Joypad_TFT-1.jpg||600px|center|thumb]]
 +
[[File:Microduino_Joypad_TFT-2.jpg||600px|center|thumb]]
  
*步骤二:将尼龙螺丝安装在Microduino-Joypad上,并且将底面板粘贴在Microduino-Joypad底部;
+
*Step 2: Fixate plastic fasteners on Microduino-Joypad; 
 
[[File:Microduino_Joypad_nilong-1.jpg||600px|center|thumb]]
 
[[File:Microduino_Joypad_nilong-1.jpg||600px|center|thumb]]
  
*步骤三:将Microduino-TFT与Microduino-Joypad通过转接线连接起来;
+
*Step 3: Stack Microduino-USBTTL, Microduino-Core on the base board of Microduino-Joypad.
 +
[[File:Microduino_Joypad_Module-1.jpg||600px|center|thumb]]
 +
 
 +
*Step 4: Connect Microduino-TFT and Microduino-Joypad through adapter cable; 
 
[[File:Microduino_Joypad_1.jpg||600px|center|thumb]]
 
[[File:Microduino_Joypad_1.jpg||600px|center|thumb]]
  
*步骤四:将电池盒连接到底板上,注意正负极别接反了,板子背面标注了正负极;
+
*Step 5: Fixate the panel and the base board with plastic fasteners; 
 +
[[File:Microduino_Joypad_face_bord-1.jpg||600px|center|thumb]]
 +
 
 +
*Step 6: If there is vibration, please install vibration motor; 
 +
[[File:Microduino_Joypad_shock-1.jpg||600px|center|thumb]]
 +
 
 +
*Step 7: Connect the battery box on the base board and make sure the electrodes are connected correctly, then paste the board at the bottom of Microduino-Joypad;
 
[[File:Microduino_Joypad_power_1.jpg||600px|center|thumb]]
 
[[File:Microduino_Joypad_power_1.jpg||600px|center|thumb]]
  
*步骤六:将Microduino-USBTTL、Microduino-Core叠加在Microduino-Joypad底座上。 [[File:Microduino_Joypad_Module-1.jpg||600px|center|thumb]]
 
  
*步骤七:将底板和面板用尼龙螺丝固定好;
+
*Step 8: You can power on and see if the power supply works fine or not. 
[[File:Microduino_Joypad_face_bord-1.jpg||600px|center|thumb]]
+
[[File:Microduino_Joypad_switch-2.jpg||600px|center|thumb]]
 +
 
 +
*If you want to install Microduino-Joypad-Game board, you need to take off the right joystick.
 +
 
 +
[[File:Microduino_Joypad_keyboard_1.jpg||600px|center|thumb]]
  
*步骤八:你可以打开电源开关,观察供电是否正常。
+
*Connect the interface of the key and the base board on the panel by a connector. 
[[File:Microduino_Joypad_switch-2.jpg||600px|center|thumb]]
+
[[File:Microduino_Joypad_keyboard_2.jpg||600px|center|thumb]]
 +
*Fixate the panel with fasteners. 
 +
[[File:Microduino_Joypad_keyboard_3.jpg||600px|center|thumb]]
  
==测试==
+
==Test==
*两个并列的Upin27底座;
+
*Two parallel UPIN27 base boards;
*两个波动开关;
+
*Two switches; 
*四个按钮;
+
*Four buttons;
*MIC声音检测输入;
+
*MIC sound detection input;
*光敏检测输入;
+
*Photosensitive detection input;
*蜂鸣器输出,接到Microduino的D6引脚上;
+
*Buzzer output, connected to D6 pin of Microduino;
*震动马达输出,接到Microduino的D8引脚上;
+
*Vibration motor output, connected to D8 pin of Microduino;
*板载Microusb供电、充电管理、3.3V稳压
+
*On-board Micro USB power supply, charging management and 3.3V stability. 
*2.54间距电池供电接口。
+
*2.54-inch pitch for power supply interface. 
  
 
[[File:Microduino-Joypad-Expansion.png|600px|thumb|center|Microduino-Joypad-Expansion]]
 
[[File:Microduino-Joypad-Expansion.png|600px|thumb|center|Microduino-Joypad-Expansion]]
  
*用到的库:
+
*Libraries needed:
**https://github.com/wasdpkj/libraries 你需要用到_01_Microduino_TFT库和_08_Microduino_Shield_Joypad库
+
**https://github.com/wasdpkj/libraries
*调试:
+
You'll need _01_Microduino_TFT and _08_Microduino_Shield_Joypad 
**所需要准备的硬件有:Microduino USBTTL、、Microduino Core、组装好的Microduino-Joypad
+
*Debugging:
**准备的软件有:支持的库文件、Arduino IDE;
+
**Hardware needed: Microduino-USBTTL, Microduino-Core and the equipped Microduino-Joypad  
**解压下载库文件,将解压后的库文件拷贝到Arduino IDE 的libraries文件夹中;
+
**Software needed: libraries and Arduino IDE;
***重新打开“Arduino-IDE”,,编译通过后,板卡选择Microduino Core (Atmega328P@16M,5V),你可以选择“”_08_Microduino_Shield_Joypad\examples里面的事例,直接下载即可;
+
**Decompress and download the library file and copy it to libraries of Arduino IDE; Decompress and download library file and then copy it to libraries of Arduino IDE;
===程序说明===
+
**Re-open “Arduino-IDE” and you can select examples in “_08_Microduino_Shield_Joypad\examples”. After successful compiling, choose the board Microduino Core (Atmega328P@16M,5V) and then download;
*读取:
+
===Program Description===
**读取光照、麦克风,扩展接口A、B的值,返回值为:int(0~1023)
+
*Read:
 +
**Read the value of A and B about illumination, MIC, extension interface. The return value should be within int(0~1023);
 +
 
 
<source lang="cpp">
 
<source lang="cpp">
//光照----------------------
+
//Illumination----------------------
 
Joypad.readLightSensor();
 
Joypad.readLightSensor();
//麦克风--------------------
+
//MIC--------------------
 
Joypad.readMicrophone();
 
Joypad.readMicrophone();
 
//INTA----------------------
 
//INTA----------------------
第57行: 第99行:
 
</source>
 
</source>
  
**读取左、右模拟摇杆的值,返回值为:int(-512~512)
+
**Read values of the left and the right analog joysticks. The return value is: int(-512~512);   
 
<source lang="cpp">
 
<source lang="cpp">
  
//左模拟摇杆----------------
+
//Left analog joystick----------------
 
Joypad.readJoystickX();
 
Joypad.readJoystickX();
 
Joypad.readJoystickY();
 
Joypad.readJoystickY();
  
//右模拟摇杆----------------
+
//Right analog joystick----------------
 
Joypad.readJoystick1X();
 
Joypad.readJoystick1X();
 
Joypad.readJoystick1Y();
 
Joypad.readJoystick1Y();
 
</source>
 
</source>
  
**读取左、右模拟摇杆值;左、右模拟摇杆按下值、拨档开关、四组按键,返回值为:Boolean(HIGH、LOW);
+
**Read the left and the right analog joystick values; The return value of the left-and-right analog joystick, switches, four-group-of-button are: Boolean(HIGH、LOW);
  
 
<source lang="cpp">
 
<source lang="cpp">
  
 
Joypad.readButton(byte ch);
 
Joypad.readButton(byte ch);
//左模拟摇杆----------------
+
//Left analog joystick----------------
 
JOYSTICK_UP;
 
JOYSTICK_UP;
 
JOYSTICK_DOWN;
 
JOYSTICK_DOWN;
第80行: 第122行:
 
JOYSTICK_RIGHT;
 
JOYSTICK_RIGHT;
 
 
//左模拟摇杆按下------------
+
//Left analog joystick press------------
 
CH_JOYSTICK_SW
 
CH_JOYSTICK_SW
 
 
//右模拟摇杆----------------
+
//Right analog joystick----------------
 
JOYSTICK1_UP;
 
JOYSTICK1_UP;
 
JOYSTICK1_DOWN;
 
JOYSTICK1_DOWN;
第89行: 第131行:
 
JOYSTICK1_RIGHT;
 
JOYSTICK1_RIGHT;
 
 
//右模拟摇杆按下------------
+
//Right analog joystick press ------------
 
CH_JOYSTICK1_SW
 
CH_JOYSTICK1_SW
 
 
//拨档开关------------------
+
//Switch ------------------
 
CH_SWITCH_L;
 
CH_SWITCH_L;
 
CH_SWITCH_R;
 
CH_SWITCH_R;
 
 
//四组按键------------------
+
//Four groups of buttons------------------
 
CH_SWITCH_1;
 
CH_SWITCH_1;
 
CH_SWITCH_2;
 
CH_SWITCH_2;
第103行: 第145行:
 
</source>
 
</source>
  
*写入:
+
*Write:
**控制蜂鸣器、振动;
+
**Control buzzer and vibration; 
 
<source lang="cpp">
 
<source lang="cpp">
 
//==========================
 
//==========================
//蜂鸣器---------------------
+
//Buzzer---------------------
 
   Joypad.tone(unsigned int freq);
 
   Joypad.tone(unsigned int freq);
 
   Joypad.tone(unsigned int freq, unsigned long duration);
 
   Joypad.tone(unsigned int freq, unsigned long duration);
 
   Joypad.noTone();
 
   Joypad.noTone();
  
//振动------------------------
+
//Vibration------------------------
 
Joypad.motor(unsigned int motor_vol);
 
Joypad.motor(unsigned int motor_vol);
“unsigned int motor_vol”:振动强弱
+
“unsigned int motor_vol”:Vibration intensity 
 
</source>
 
</source>
  
==开始应用==
+
==Start Application==
[[Microduino-Joypad 应用教程]]
+
[[Microduino-Joypad Application Tutorial]]
 
|}
 
|}

2016年1月6日 (三) 01:36的最新版本

Language English
  • Microduino modules needed
Module Number Function
Microduino-Joypad 1 Remote controller
Microduino-Core 1 Core board
Microduino-USBTTL 1 Program download
  • Other Equipment
Module Number Function
USB cable 1 Data transmission
Battery box 1 Battery load
7th battery 3 Power supply
  • Step 1: Install Microduino-TFT on the panel of Microduino-Joypad;
  • Step 2: Fixate plastic fasteners on Microduino-Joypad;
  • Step 3: Stack Microduino-USBTTL, Microduino-Core on the base board of Microduino-Joypad.
  • Step 4: Connect Microduino-TFT and Microduino-Joypad through adapter cable;
  • Step 5: Fixate the panel and the base board with plastic fasteners;
  • Step 6: If there is vibration, please install vibration motor;
  • Step 7: Connect the battery box on the base board and make sure the electrodes are connected correctly, then paste the board at the bottom of Microduino-Joypad;


  • Step 8: You can power on and see if the power supply works fine or not.
  • If you want to install Microduino-Joypad-Game board, you need to take off the right joystick.
  • Connect the interface of the key and the base board on the panel by a connector.
  • Fixate the panel with fasteners.

Test

  • Two parallel UPIN27 base boards;
  • Two switches;
  • Four buttons;
  • MIC sound detection input;
  • Photosensitive detection input;
  • Buzzer output, connected to D6 pin of Microduino;
  • Vibration motor output, connected to D8 pin of Microduino;
  • On-board Micro USB power supply, charging management and 3.3V stability.
  • 2.54-inch pitch for power supply interface.
文件:Microduino-Joypad-Expansion.png
Microduino-Joypad-Expansion

You'll need _01_Microduino_TFT and _08_Microduino_Shield_Joypad

  • Debugging:
    • Hardware needed: Microduino-USBTTL, Microduino-Core and the equipped Microduino-Joypad
    • Software needed: libraries and Arduino IDE;
    • Decompress and download the library file and copy it to libraries of Arduino IDE; Decompress and download library file and then copy it to libraries of Arduino IDE;
    • Re-open “Arduino-IDE” and you can select examples in “_08_Microduino_Shield_Joypad\examples”. After successful compiling, choose the board Microduino Core (Atmega328P@16M,5V) and then download;

Program Description

  • Read:
    • Read the value of A and B about illumination, MIC, extension interface. The return value should be within int(0~1023);
	//Illumination----------------------
	Joypad.readLightSensor();
	//MIC--------------------
	Joypad.readMicrophone();
	//INTA----------------------
	Joypad.readIntA();
	//INTB----------------------
	Joypad.readIntB();
    • Read values of the left and the right analog joysticks. The return value is: int(-512~512);
	//Left analog joystick----------------
	Joypad.readJoystickX();
	Joypad.readJoystickY();

	//Right analog joystick----------------
	Joypad.readJoystick1X();
	Joypad.readJoystick1Y();
    • Read the left and the right analog joystick values; The return value of the left-and-right analog joystick, switches, four-group-of-button are: Boolean(HIGH、LOW);
	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;
  • Write:
    • Control buzzer and vibration;
//==========================
	//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

Microduino-Joypad Application Tutorial