tags: arduino Internet of Things
Key rocker
1. The purpose of the experiment
Joysticks are generally widely used in equipment such as model airplanes, video games, remote control cars, pan-tilts, etc. Many devices with screens often use joysticks as input controls for menu selection.
Arduino Uno, supporting USB data cable, key rocker module, four DuPont cables

Key rocker
VCC----5V,GND-----GND,X-----A0,Y-----A1
#define pinX A0
#define pinY A1
int value = 0;
void setup()
{
pinMode(pinK, INPUT);
Serial.begin(9600);
}
void loop()
{
value = analogRead(pinX);
Serial.print("X: ");
Serial.print(value);
value = analogRead(pinY);
Serial.print(" Y: ");
Serial.println(value);
delay(1000);
}

Arduino-key rocker
The joystick is used to replace the touch buttons in many applications. Not only is it convenient to operate, but one joystick can replace multiple buttons, which simplifies the circuit design. This a...
Materials arduino uno Joystick module x1 SG90 servo x2 Bread line Two-axis gimbal (not necessary) Code 1. Servo.h controls the servo, the servo can be connectedD0~D13 can work normally, A...
Many classic mini games, such as Snake and Tetris, are displayed on the screen through button control. When the joystick meets the display, we can try many interesting experiments. This article contro...
Reprinted at: https://blog.51cto.com/libinqi456/1602716...
Joystick virtual joystick multi touch -output 4-quadrant coordinate output Standard unit Cartesian system, control center (0, 0) xAxis: Value range [-1,1], left value<0, right value>0 yAxis: Val...
Previous article We introduced how to use the NOKIA 5110 LCD module to display (refer to the previous Wen'zhan), now we can develop some small games, such as the most classic greedy snake, then we com...
The previous article wrote several common protagonist control methods, this article will introduce the use of joystick JoyStick to control the protagonist. Seeing that all the code written by JS is on...
This input method of virtual joystick is believed to be quite familiar to everyone on the mobile game platform. First of all, let's briefly understand the design principle of virtual joyst...
Article Directory Preface Joystick introduction Technical characteristics Source code Get joystick function information Get the current state of the joystick Preface Based on the introduction of the p...