Arduino Joystick Shield


₫ 39.000

Sản phẩm Arduino Joystick Shield đang được mở bán với mức giá siêu tốt khi mua online, giao hàng online trên toàn quốc với chi phí tiết kiệm nhất,1 đã được bán ra kể từ lúc chào bán lần cuối cùng.Trên đây là số liệu về sản phẩm chúng tôi thống kê và gửi đến bạn, hi vọng với những gợi ý ở trên giúp bạn mua sắm tốt hơn tại Pricespy Việt Nam

Mô tả:
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


————————–CODE THAM KHẢO———————-

Thư viện JoystickShield.h

/**
* 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 // 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(50

Sản Phẩm Liên Quan

HOT

Bikini hàng Âu

₫ 400.000
HOT
HOT

Bikini Thái

₫ 300.000
HOT

Bikini OKISS- QCXK

₫ 400.000
HOT

Bikini xuất Âu

₫ 300.000