Difference between revisions of "Sensor-Joystick"
From Microduino Wiki
(→Specification) |
(→Specification) |
||
Line 20: | Line 20: | ||
**Input device | **Input device | ||
*Tech parameters | *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. | + | **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 | **Analog input | ||
*Size | *Size | ||
− | **Size of the switch: 17mm* | + | **Size of the switch: 17mm*17mm |
**Size of the board: 20mm*24mm | **Size of the board: 20mm*24mm | ||
**1.27mm-pitch 4Pin interface connects with Sensorhub. | **1.27mm-pitch 4Pin interface connects with Sensorhub. |
Revision as of 09:22, 9 September 2016
Language: | English • 中文 |
---|
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.
ContentsFeatures
Specification
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
|