Arduino Joystick Shield
Mã sản phẩm: (Đang cập nhật...)
Thương hiệu: cập nhật
Còn hàng
65.000₫
Freeship đơn hàng từ 500k
Kiểm tra khi nhận hàng
Hỗ trợ khách hàng 24/7
- Thông tin sản phẩm
- Hướng dẫn
Arduino JoyStick Shield được thiết kế để kết hợp với Arduino như 1 tay cầm điều khiển chuyên nghiệp, Shield hỗ trợ 1 Joystick và 6 phím nhấn điều khiển linh hoạt, ngoài ra còn có các socket để thể gắn thêm các mạch như: NRF24L01+, LCD Nokia5110, Bluetooth HC-06, ngõ ra giao tiếp I2C,….
Sơ đồ chân kết nối:
- Mạch thu phát RF nRF24L01+: IRQ-D8 CE-D9 CSN-D10 MOSI-D11 MISO-D12 CLK-13
- Mạch thu phát Bluetooth HC-06: RXD-D1 TXD-D0
- Nút bấm – Button: A~D2 B~D3 C~D4 D~D5 E~D6 F~D7 X~A0 Y~A1 Key_Joystick~D8
- Màn hình Nokia 5110: 3V3 GND D13 D12 D11 D10 D9 3V3

Trên Arduino Joystick shield gồm có 7 nút nhấn:
– 4 nút điều khiển lớn
– 2 nút điều khiển nhỏ
– Và 1 cần điêu khiển Joystick 2 trục
Sơ đồ kích thước

Sơ đồ mạch

Sơ đồ kết nối với arduino

Hình Ảnh Arduino Joystick Shield:



————————–CODE THAM KHẢO———————-
/**
* kết nối shield với arduino nạp code mở Serial Monitor, chọn No line ending, baud 9600 để kiểm tra.
*/
#include <JoystickShield.h> // include JoystickShield Library
JoystickShield joystickShield; // create an instance of JoystickShield object
void setup()
{
Serial.begin(9600);
delay(100);
}
void loop() {
joystickShield.processEvents();
if (joystickShield.isUp())
{
Serial.println("Up") ;
}
if (joystickShield.isRightUp())
{
Serial.println("RightUp") ;
}
if (joystickShield.isRight())
{
Serial.println("Right") ;
}
if (joystickShield.isRightDown()) {
Serial.println("RightDown") ;
}
if (joystickShield.isDown()) {
Serial.println("Down") ;
}
if (joystickShield.isLeftDown()) {
Serial.println("LeftDown") ;
}
if (joystickShield.isLeft()) {
Serial.println("Left") ;
}
if (joystickShield.isLeftUp()) {
Serial.println("LeftUp") ;
}
if (joystickShield.isJoystickButton()) {
Serial.println("Joystick Clicked") ;
}
if (joystickShield.isUpButton()) {
Serial.println("Up Button Clicked") ;
}
if (joystickShield.isRightButton()) {
Serial.println("Right Button Clicked") ;
}
if (joystickShield.isDownButton()) {
Serial.println("Down Button Clicked") ;
}
if (joystickShield.isLeftButton()) {
Serial.println("Left Button Clicked") ;
}
// new eventfunctions
if (joystickShield.isEButton()) {
Serial.println("E Button Clicked") ;
}
if (joystickShield.isFButton()) {
Serial.println("F Button Clicked") ;
}
if (joystickShield.isNotCenter()){
Serial.println("NotCenter") ;
}
// new position functions
Serial.print("x "); Serial.print(joystickShield.xAmplitude());Serial.print(" y ");Serial.println(joystickShield.yAmplitude());
delay(500);
}
Xem thêm
Thu gọn
Xin mời nhập nội dung tại đây