Grove - Thumb Joystick

Similar documents
Grove - Thumb Joystick

Grove - Vibration Motor

Grove - 80cm Infrared Proximity Sensor

Grove - Magnetic Switch

Grove - Rotary Angle Sensor

Grove - PIR Motion Sensor

Grove - Moisture Sensor

Grove - Single Axis Analog Gyro

Grove - 80cm Infrared Proximity Sensor User Manual

Grove - Moisture Sensor

Grove - 2-Coil Latching Relay

Grove - Luminance Sensor

Grove - Digital Light Sensor

Grove - 3 Axis Digital Accelerometer±16g Ultra-low Power (BMA400)

Grove - Solid State Relay

Grove - 6-Axis Accelerometer&Gyroscope(BMI088)

Grove - Multichannel Gas Sensor

Grove - I2C ADC. Introduction. Features

Grove - 3-Axis Digital Compass User Manual

Grove - CO2 Sensor. Introduction

Grove - Fingerprint Sensor

Grove - RTC User Manual

Grove - Buzzer. Introduction. Features

Grove - I2C Thermocouple Amplifier (MCP9600)

Parameters. Specifications. Bluetooth Specification V4.0 BLE. Modulation method GFSK(Gaussian Frequency Shift Keying)

Grove - Mini I2C Motor Driver v1.0

Grove - 3-Axis Digital Accelerometer(±16g)

Light Sensor. Overview. Features

Grove - OLED Display 0.96''

The Big Idea: Background: About Serial

Arduino - DigitalReadSerial

3.3V 5.0V. display. Low. Wide. Warning. screen.

This module can be used to build a light controlled switch i.e. switch off lights during day time and switch on lights during night time.

EP486 Microcontroller Applications

Thumb Joystick Retail. Tools and parts you'll need. Things you'll want to know. How does it work? Skill Level: Beginner. by MikeGrusin March 22, 2011

FIRE SENSOR ROBOT USING ATMEGA8L

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino

Grove - Ultrasonic Ranger

<Table of content> <Parts and description> <Circuit board Guide> <Pins> <Basics of Coding> <Intro to Arduino> <Intro> <Downloading Arduino IDO>

Arduino Programming Part 3. EAS 199A Fall 2010

Robotics/Electronics Review for the Final Exam

Input Shield For Arduino SKU: DFR0008

Introduction to Programming. Writing an Arduino Program

Create your own wireless motion sensor with

CONSTRUCTION GUIDE Remote Big Wheel. Robobox. Level VIII

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail

ROBOTLINKING THE POWER SUPPLY LEARNING KIT TUTORIAL

TABLE OF CONTENTS INTRODUCTION LESSONS PROJECTS

User manual. For Keenlon Rarduino.

Sten-SLATE ESP Kit. Description and Programming

IME-100 ECE. Lab 4. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

Gravity: I2C ADS Bit ADC Module(Arduino & Raspberry Pi Compatible) SKU: DFR0553

myservoa.attach(3); // attaches the servo on pin 3 to the servo object //copy from servo code

Grove Digital Extender 0059-GRVDE-DSBT/SF

Controlling a fischertechnik Conveyor Belt with Arduino board

USB PowerControl 0042-USBPC-DSBT / USBPCNE-DSBT

4Serial SIK BINDER //77

Lecture 7. Processing Development Environment (or PDE)

Introduction to Arduino Programming. Sistemi Real-Time Prof. Davide Brugali Università degli Studi di Bergamo

This is a tutorial about sensing the environment using a Raspberry Pi. measure a digital input (from a button) output a digital signal (to an LED)

Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

Instruction Manual. Model RBA18

Designed & Developed By: Ms. Jasleen Kaur, PhD Scholar, CSE. Computer Science & Engineering Department

Introduction to Arduino

IES-SHIELD-SCX18 Quick Start Guide

Raspberry Pi Relay Board v1.0

TMP36 Temperature Sensor

Electronics Single Board Computers

Joy-IT Ultrasonic Distance Sensor

FireBeetle ESP8266 IOT Microcontroller SKU: DFR0489

Rotary Encoder Basics

J. La Favre Calibrating Sharp Distance Sensors July 18, 2018

Arduino Programming. Arduino UNO & Innoesys Educational Shield

Gooligum Electronics 2015

Sanguino TSB. Introduction: Features:

ARDUINO UNO R3 BASED 20A ROBOT CONTROL BOARD [RKI-1580] Page 1

Sensors Provide Feedback to Real World Applications. Jared Gordon. Professor: Pushkin Kachroo. Transpotronics

How to Use an Arduino

Temperature Sensor. Overview. Features

ADC to I 2 C. Data Sheet. 10 Channel Analog to Digital Converter. with output via I 2 C

Triple Axis Accelerometer FXLN83XX Series

ISL RGB Sensor Tutorial By: Sabrina Jones

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

Thunder Board 0240-THNDRBRD-DSBT

RS422/RS485 Shield. Application Note: Multiple RS485 busses. 1 Introduction

Blue Point Engineering

ipot Phase 1 1

Introduction to Arduino. Wilson Wingston Sharon

SD Card shield V4.0. Introduction. Application Ideas. Music Player with LinkIt One

SPDM Level 2 Smart Electronics Unit, Level 2

Electronic Brick Starter Kit

How to receive codes from a wireless remote on your Raspberry Pi.

Grove - Gesture V1.0. Introduction. Features

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

FG series FIXED GRIP hand controllers

Using the BMP085/180 with Raspberry Pi or Beaglebone Black

Introduction to GoPiGo 9/12/2017

Serial.begin ( ); Serial.println( ); analogread ( ); map ( );

I2CMux Grove Board 0057-GRV4I2CMux-DSBT/ SF

Arduino Programming and Interfacing

Transcription:

Grove - Thumb Joystick Introduction 3.3V 5.0V Analog Grove - Thumb Joystick is a Grove compatible module which is very similar to the analog joystick on PS2 (PlayStation 2) controllers. The X and Y axes are two ~10k potentiometers which control 2D movement by generating analog signals. The joystick also has a push button that could be used for special applications. When the module is in working mode, it will output two analog values, representing two directions. Compared to a normal joystick, its output values are restricted to a smaller range (i.e. 200~800), only when being pressed that the X value will be set to 1023 and the MCU can detect the action of pressing. Features Grove Interface 5V/3.3V Compatible Analog Output Tip More details about Grove modules please refer to Grove System Application Ideas Game Controller Robot remote

Project - 2048 Game This is a Pi game project which is consists of Gorve - Thumb Joystick. Click on the images below to get more information about this project. Specifications Item Min Typical Max Unit Working Voltage 4.75 5.0 5.25 V Output Analog Value (X coordinate) Output Analog Value (Y coordinate) 206 516 798 \ 203 507 797 \ Platforms Supported Arduino Wio BeagleBone Raspberry Pi LinkIt ONE Caution The platforms mentioned above as supported is/are an indication of the module's hardware or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Usage With Arduino The Grove - Thumb Joystick is an analog device that outputs analog signal ranging from 0 to 1023. That requires us to use the analog port of Arduino to take the readings. 1.Connect the module to the A0/A1 of Grove - Base Shield using the 4-pin grove cable. 2.Plug the Grove - Basic Shield into Arduino. 3.Connect Arduino to PC by using a USB cable. 4.Copy and paste code below to a new Arduino sketch. /* Thumb Joystick demo v1.0 by:http://www.seeedstudio.com connect the module to A0&A1 for using; */ void setup() { Serial.begin(9600); }

void loop() { int sensorvalue1 = analogread(a0); int sensorvalue2 = analogread(a1); Serial.print("The X and Y coordinate is:"); Serial.print(sensorValue1, DEC); Serial.print(","); Serial.println(sensorValue2, DEC); Serial.println(" "); delay(200); } 5.You can check the values of the output analog signals by opening the Serial Monitor. The output value from the analog port of Arduino can be converted to the corresponding resistance using the formula:r=(float)(1023- sensorvalue)*10/sensorvalue.

With Raspberry Pi 1.You should have got a raspberry pi and a grovepi or grovepi+. 2.You should have completed configuring the development enviroment, otherwise follow here. 3.Connection Plug the sensor to grovepi socket A0 by using a grove cable. 4.Navigate to the demos directory: cd yourpath/grovepi/software/python/ To see the code nano grove_thumb_joystick.py # "Ctrl+x" to exit # import time import grovepi # Connect the Grove Thumb Joystick to analog port A0 # GrovePi Port A0 uses Arduino pins 0 and 1 # GrovePi Port A1 uses Arduino pins 1 and 2 # Don't plug anything into port A1 that uses pin 1 # Most Grove sensors only use 3 of their 4 pins, which is why the GrovePi shares Arduino pins between adjacent ports # If the sensor has a pin definition SIG,NC,VCC,GND, the second (white) pin is not connected to anything # If you wish to connect two joysticks, use ports A0 and A2 (skip A1) # Uses two pins - one for the X axis and one for the Y axis # This configuration means you are using port A0 xpin = 0 ypin = 1

grovepi.pinmode(xpin,"input") grovepi.pinmode(ypin,"input") # The Grove Thumb Joystick is an analog device that outputs analog signal ranging from 0 to 1023 # The X and Y axes are two ~10k potentiometers and a momentary push button which shorts the x axis # My joystick produces slightly different results to the specifications found on the url above # I've listed both here: # Specifications # Min Typ Max Click # X 206 516 798 1023 # Y 203 507 797 # My Joystick # Min Typ Max Click # X 253 513 766 1020-1023 # Y 250 505 769 while True: try: # Get X/Y coordinates x = grovepi.analogread(xpin) y = grovepi.analogread(ypin) # Calculate X/Y resistance Rx = (float)(1023 - x) * 10 / x Ry = (float)(1023 - y) * 10 / y # Was a click detected on the X axis? click = 1 if x >= 1020 else 0 print "x =", x, " y =", y, " Rx =", Rx, " Ry =", Ry, " click =", click time.sleep(.5)

except IOError: print "Error" 5.Run the demo. sudo python grove_thumb_joystick.py