Sparkfun Joystick Shield

1 Review
81,00 Lei 61,00 Lei
Stoc sku: SHL-11
In stoc

Durata de livrare: 1 - 3 zile lucratoare

Limita stoc
Adauga in cos
Cod Produs: 00003183 Ai nevoie de ajutor? +40 373 813 088
La achizitionarea acestui produs primiti 3 Lei pentru comenzile viitoare
Adauga la Favorite Cere informatii
  • Descriere
  • Review-uri (1)

Shield Joystick pentru Arduino.

 

 

 

Exemplu:

 

char button0=3, button1=4, button2=5, button3=6;

char sel=2;

 

void setup(void)

{

  pinMode(sel, INPUT);      //Set the Joystick 'Select'button as an input

  digitalWrite(sel, HIGH);  //Enable the pull-up resistor on the select button

  

  pinMode(button0, INPUT);      //Set the Joystick button 0 as an input

  digitalWrite(button0, HIGH);  //Enable the pull-up resistor on button 0

 

  pinMode(button1, INPUT);      //Set the Joystick button 1 as an input

  digitalWrite(button1, HIGH);  //Enable the pull-up resistor on button 1

  

  pinMode(button2, INPUT);      //Set the Joystick button 2 as an input

  digitalWrite(button2, HIGH);  //Enable the pull-up resistor on button 2

 

  pinMode(button3, INPUT);      //Set the Joystick button 3 as an input

  digitalWrite(button3, HIGH);  //Enable the pull-up resistor on button 3

  

  Serial.begin(9600);           //Turn on the Serial Port at 9600 bps

}

 

void loop(void)

{

  Serial.print(analogRead(0));          //Read the position of the joysticks X axis and print it on the serial port.

  Serial.print(",");

  Serial.print(analogRead(1));          //Read the position of the joysticks Y axis and print it on the serial port.

  Serial.print(",");

  Serial.print(digitalRead(sel));       //Read the value of the select button and print it on the serial port.

  Serial.print(digitalRead(button0));   //Read the value of the button 0 and print it on the serial port.

  Serial.print(digitalRead(button1));   //Read the value of the button 1 and print it on the serial port.

  Serial.print(digitalRead(button2));   //Read the value of the button 2 and print it on the serial port.

  Serial.println(digitalRead(button3)); //Read the value of the button 3 and print it on the serial port.

  

  //Wait for 100 ms, then go back to the beginning of 'loop' and repeat.

  delay(100);

}

Linkuri:

Asamblare

Tutorial

Schema

Eagle

Exemplu Arduino

Daca doresti sa iti exprimi parerea despre acest produs poti adauga un review.

Review-ul a fost trimis cu succes.

Ioan Popovici,

Cateva dintre linkurile de mai sus nu sunt corecte.

Raspunde

A fost util acest review?

Suport clienti Email tehnic si cereri de oferta B2B: contact@robofun.ro

+40 373 813 088 info@robofun.ro

Compara produse

Trebuie sa mai adaugi cel putin un produs pentru a compara produse.

A fost adaugat la favorite!

A fost sters din favorite!