查看“Microduino-Joystick”的源代码
←
Microduino-Joystick
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{Language|Microduino-Joystick }} {| style="width: 800px;" |- | [[File: Microduino-Joystick.jpg|400px|thumb|right| Microduino-Joystick]] Microduino-Joystick is a joystick sensor, which can detect horizontal displacement of a joystick. It can return analog values of X-axis and Y-axis via the analog port, whose range is between 0-1,023. ==Features== *With X- and Y-axis directions. *Small and beautiful ==Specification == *Electrical specification **Operation voltage: 3.3V~5V **Input device *Tech parameters **Pin description: GND, VCC, signal 1 output and signal 2 output. Since the output signal is simulated, you can use analog port to detect (A0-A7) by connecting to the pins including A7/A6,A3/A2 and A1/A0 of Sensorhub. **Analog input *Size **Size of the switch: 17mm*17mm, **Size of the board: 20mm*24mm **1.27mm-pitch 4Pin interface connects with Sensorhub. [[file:mCookie-sensorhub_rule.JPG|thumb|800px|center]] [[File: Microduino-Joystick_rule1.jpg|600px|thumb|center]] ==Document== *Schematic: '''[[File: Microduino_ Joystick.Zip]]''' ==Development== ===Preparation=== *Make sure you build Microduino IDE or refer to: [[Microduino Getting started]] *Core selection **1. Adopt [[Microduino-CoreUSB]] or [[mCookie-CoreUSB]] as the core. **2. Adopt [[Microduino-Core]] or [[Microduino-Core+]] as the core plus [[Microduino-USBTTL]] as the program download module. ===Program=== <source lang="cpp"> void setup() { Serial.begin(9600); //Serial port initializing } void loop() { int sensorValueX = analogRead(A0); //X-axis input int sensorValueY = analogRead(A1); //Y-axis input float voltageX = sensorValueX * (5.0 / 1023.0); float voltageY = sensorValueY * (5.0 / 1023.0); Serial.print(voltageX); Serial.print(","); Serial.println(voltageY); delay(50); } } </source> ===Hardware Buildup=== *Stack all modules firstly, then connect Microduino-Joystick with Sensorhub to A0/A1 port with a wire. Please refer to: [[Microduino-Sensorhub]] [[file:Microduino-sensorhub_Analog.PNG|thumb|400px|center]] Please refer to: [[mCookie-Hub]] [[file:mCookie-sensorhub_Analog.PNG|thumb|400px|center]] *Connect the core, Sensorhub and LED to a computer with a USB cable. *Select the right board and COM port, compile and download. You can refer to [[AVR Core:Getting started]] [[file:upload.JPG|thumb|800px|center]] *Choose the right port number from Tools→Serial Port in Arduino IDE after compiling and then download program. *Open the serial monitor after download and you'll see analog quantities on the direction of X-axis and Y-axis displayed on the console. When the joystick is in the middle, it displays around 2.5 on both X-axis and Y-axis. ==Application== You can simulate mouse movement and other displacement sensors as human-computer interaction input. ===Project=== * '''[[The Use of Joystick Sensor]]''' ==Purchase== ==History== ==Pictures== *Front [[file: Microduino-Joystick-F.JPG|thumb|600px|center|Microduino-Joystick Front]] *Back [[file: Microduino-Joystick -b.JPG|thumb|600px|center|Microduino-Joystick Back]] |}
该页面使用的模板:
模板:Language
(
查看源代码
)
模板:Nmbox
(
查看源代码
)
返回至
Microduino-Joystick
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
Welcome
首页
创客大赛
大赛详情
3D打印
安装月球车
图形化编程
操控月球车
升级月球车
编程工具下载
软件下载
Arduino
Processing
Mixly
Scratch
模块套件
Microduino 102
mCookie 102
mCookie 202
mCookie 302
IBC
其他
应用套件
四轴飞行器
平衡车
小车CUBE
音乐播放器
刷卡音乐播放器
wifi气象站
彩虹音乐触摸灯
分贝检测仪
迎门汇报
LED点阵时钟
LED点阵屏幕
硬件
mCookie
Sensor
Microduino
MicroWrt
MicroNux
MicroRobot-Core
MicroRobot-CoreESP
ideaBoard
ideaBox
MicroMV
MicroAI
帮助
常见问题
帮助
工具
链入页面
相关更改
特殊页面
页面信息