Categorii




   Comanda Direct Furnizor
   Consultanta Tehnica
   Ticket Garantie
   Problema Livrare
   Retur Produse
   Feedback
   Verifica Status


Joystick Shield

Joystick Shield
Joystick Shield Joystick Shield Joystick Shield Joystick Shield Joystick Shield
Brand: Sparkfun
Cod Produs: SHL-11 503
Stoc :8 buc
Pret: 81 RON 73 RON (TVA inclus)
Cantitate:  

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

Scrie un review / pune o intrebare in zona de mai jos.

Intrebarea / review-ul tau va fi publicata pe site in cel mai scurt timp posibil (pe langa intrebarile scrise de clienti, cu acest formular mai interactioneaza si unii boti si servicii de spam automate care incearca sa ne vanda Viagra, postari pe care este necesar sa le filtram manual :)
.

Numele tau


Adresa ta de email (nu o vom face publica, nu va fi publicata nicaieri pe site)


Intrebarea / review-ul tau

Rating: Bad           Good


Introdu codul in caseta de mai jos:



Robofun © 2019