background image

ROBOT . HEAD to TOE

                                                                    

Product User’s Manual – Shield­PS2

5.0 HARDWARE INTERFACE

This section shows the example of using SHIELD­PS2 with Arduino UNO as the main controller.

 

 

 

 

   

 

 

 

 

   

 

 

However, other Arduino main board such as Arduino Duemilanove and Arduino Mega can also be

 

 

 

 

 

   

 

 

 

 

 

 

 

used.

Figure below shows that the SHIELD­PS2 is stacked on the Arduino UNO. Please ensure that the

 

 

 

 

 

   

   

 

 

 

 

 

 

pins alignment is correct.

Select the pins for UART’s TX and RX. Pin D0 and D1 are

hardware serial

of most arduino main

 

 

 

 

 

 

 

 

 

 

 

 

 

 

   

 

 

board. Other selectable pin for TX and RX on Shield­PS2 are software serial pin. The default TX

 

 

 

 

 

 

 

   

 

 

 

 

 

 

 

pin is set to D3 while the RX pin is set to D2. However, other pins may be selected if these pins are

   

   

 

 

 

 

   

   

 

 

 

 

   

   

 

 

already used by other application. If hardware serial pin (D0, D1) is selected, user needs to

unplug

 

   

 

   

 

 

 

 

   

 

 

   

the

PS2 Connector

from the Shield­PS2 before start to program the main board. Programming of

 

 

 

 

 

 

 

   

 

 

 

 

 

main board may fail if the Shield­PS2 is stacked on mainboard and PS2 controller connector is

 

 

 

   

 

   

 

 

 

 

 

 

 

connected.  Select desired baudrate for Shield­PS2 using the mini jumper.

Guideline to choose pin for software serial:

 Not all pins on the Mega and Mega 2560 support change interrupts,

 so only the following can be used for RX:

 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

 Not all pins on the Leonardo support change interrupts,

 so only the following can be used for RX:

 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved

8

Содержание Shield-PS2

Страница 1: ...ROBOT HEAD to TOE Product User s Manual Shield PS2 Shield PS2 Cytron PS2 Shield User s Manual V1 0 September 2013 Created by Cytron Technologies Sdn Bhd All Rights Reserved 1...

Страница 2: ...on and Limitations 5 4 Board and Product Layout 6 5 Hardware Interface 8 5 1 Choose SONY PS2 Dual Shock Controller 10 6 Protocol 15 6 1 PS2 Button and joystick status 15 6 2 On Board vibrator motor co...

Страница 3: ...d or wireless Shield PS2 has stackable side headers which allows for more Arduino shields to be stacked on top of it Besides user has option to use either hardware or software UART with Arduino s main...

Страница 4: ...t User s Manual Shield PS2 2 0 PACKING LIST 1 1 x Shield PS2 2 3 x mini jumper 3 User s manual and sample source code can be downloaded from http www cytron com my Created by Cytron Technologies Sdn B...

Страница 5: ...TATIONS Dimensions No Parameters Min Typical Max Unit 1 Input Voltage Logic Operation Voltage 4 5 5 5 V 2 Current Consumption 100 150 500 mA 3 VIOH Logic Input High Level 3 5 5 0 5 5 V 4 VIOL Logic In...

Страница 6: ...eader This is the analog port of the Arduino The stackable header allows other stacked shield to utilize these pins 2 Stackable Power Pins Header This is the power port of the Arduino The stackable he...

Страница 7: ...shows that power is supplied to Cytron PS2 Shield 6 Baud Rate selector To select the preferable UART baud rate For Cytron PS2 Shield to obtain latest baudrate from selector Shield PS2 need to be reset...

Страница 8: ...et to D2 However other pins may be selected if these pins are already used by other application If hardware serial pin D0 D1 is selected user needs to unplug the PS2 Connector from the Shield PS2 befo...

Страница 9: ...ary can be downloaded from the SHIELD PS2 product page at Cytron s website Connect the PS2 joystick to the PS2 connector socket on SHIELD PS2 as shown Don t forget about the power source for the Ardui...

Страница 10: ...ROBOT HEAD to TOE Product User s Manual Shield PS2 Created by Cytron Technologies Sdn Bhd All Rights Reserved 10...

Страница 11: ...d wireless type of SONY PS2 controller There are many types of PS controller in the market and the sensitivity for each type also different User is advised to use original PS2 controller Cytron Techno...

Страница 12: ...ave 2 axes and there are two formats of output These formats will be explained later User may choose format 1 or format 2 NOTE SONY PS2 controller does not come with PS2 Shield please purchase separat...

Страница 13: ...eft value change from 128 to 0 Push towards right value change from 128 to 255 Left joystick have X axis and Y axis Right joystick also have its own X and Y axis Analog value of Format 1 Taking an exa...

Страница 14: ...to left down corner The value of left joystick will change will should get approximately j_ll 10 j_ld 50 You can choose whichever format to use by sending particular command to PS2 Shield Please do t...

Страница 15: ...ean X axis format 1 range 0 to 255 y mean Y axis format 1 range 0 to 255 u mean Up axis format 2 range 0 to 100 d mean Down axis format 2 range 0 to 100 l mean Left axis format 2 range 0 to 100 r mean...

Страница 16: ...entre button right joystick centre button START button up button right button down button left button L2 button R2 button L1 button R1 button triangle button circle button cross button square button A...

Страница 17: ...28 Return the connection status of PS2 controller on Shield PS2 Shield PS2 will read PS2 controller status 1 is return if controller is detected or connected to the PS2 connector on Shield PS2 6 2 On...

Страница 18: ...l group 1 bit 7 MSB Left button bit 6 Down button bit 5 Right button bit 4 Up button bit 3 Start button bit 2 Right Joystick Center button bit 1 Left Joystick Center button bit 0 LSB Select button Dig...

Страница 19: ...d PS2 Examples Example of UART communication shows main board obtain the Circle button of PS2 Example of UART communication shows mainboard obtain the Left jostick X axis value of PS2 Created by Cytro...

Страница 20: ...by misuse is not covered under warranty Warranty does not cover freight cost for both ways Prepared by Cytron Technologies Sdn Bhd 19 Jalan Kebudayaan 1A Taman Universiti 81300 Skudai Johor Malaysia T...

Отзывы: