Sensor-Joystick
From Microduino Wiki
Revision as of 02:53, 28 October 2015 by 1304410487@qq.com (talk) (Created page with "{{Language|Microduino-Joystick }} {| style="width: 800px;" |- | 400px|thumb|right| Microduino-Joystick Microduino-Joystick is a joystick sen...")
Language: | English • 中文 |
---|
Microduino-Joystick is a joystick sensor, which can detect horizontal displacement of a joystick.
ContentsFeatures
Specification
**Input device
Document
DevelopmentPreparation
Programvoid 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);
}
} Hardware Buildup
Please refer to: Microduino-Sensorhub Please refer to: mCookie-Hub
ApplicationYou can simulate mouse movement and other displacement sensors as human-computer interaction input. ProjectPurchaseHistoryPictures
|