pitsco Tetrix Max Скачать руководство пользователя страница 9

TETRIX Tele-Op Control Module Arduino Library Functions Chart 

for the SONY DUALSHOCK 4 Gaming Controller

The Tele-Op module ships with firmware for the PS4 gaming controller installed. Please be sure to download and install 

the latest version of the Tele-Op Arduino libraries at 

Pitsco.com/TETRIX-Tele-Op-Control-Module#downloads

 for the 

most up-to-date programming features and functionality.

Description  

Function

Coding Example

Get PS4 Controller Data

Reads the status of all analog and 

digital buttons and joysticks from a 

PS4 game controller connected to the 

Tele-Op module.

Be sure to call this function as 

frequently as possible in your Arduino 

code. Each time it is called, the data 

from the PS4 gaming controller is 

refreshed.

ps4.

getPS4

();

Data Returned: None

void

 

loop

() {

  ps4.

getPS4

();

}

Check Connection

Checks to see if the PS4 gaming 

controller has been successfully 

connected to the Tele-Op module.

ps4.

Connected

;

Data Returned:

0 = PS4 has disconnected

1 = PS4 has connected

void

 

loop

() {

   ps4.

getPS4

();  

   if (ps4.

Connected

) {

     // do this if connected

   } else {

     // do this if not connected

   }

}

Check Range

Checks to see if the PS4 gaming 

controller Bluetooth signal is in range 

of the Tele-Op module.

ps4.

inRange

;

Data Returned:

0 = PS4 is out of range

1 = PS4 is in range

void

 

loop

() {

   ps4.

getPS4

();  

   if (ps4.

inRange

) {

     // do this if in range

   } else {

     // do this if not in range

   }

}

Reset Tele-Op Module

Force resets the module; equivalent to 

physically pressing the red Stop/Reset 

button.

ps4.

resetTeleOp

();

Data Returned: None

ps4.

resetTeleOp

();

Note: 

Call this function 

once

 in code 

if there is a need to reset the Tele-Op 

module.

Read Digital Button Status

Returns the status of a PS4 controller 

digital button.

Digital button function parameters 

are:

L1, L2, L3

R1, R2, R3

UP, DOWN, RIGHT, LEFT

TRIANGLE, CROSS, CIRCLE, SQUARE

SHARE, OPTIONS, POWER, TOUCH

ps4.

Button

(

L1

);

Data Returned:

0 = Button not pressed

1 = Button pressed

void

 

loop

() {

   ps4.

getPS4

();  

   if (ps4.

Button

(

L1

)) {

     // do this if pressed

   } else {

     // do this if not pressed

   }

}

Read Analog Button Status

Returns the status of a PS4 controller 

analog trigger button.

Analog buttons are the L2 and R2 

trigger buttons. 

Analog button parameters are:

L2T, R2T

ps4.

Button

(

L2T

);

or

ps4.

Button

(

R2T

);

Data Returned: Integer

Data Range: 0-255

void

 

loop

() {

   ps4.

getPS4

();  

   int x = ps4.

Button

(

L2T

);

}

The analog value (0-255) of the L2 

trigger button is stored in variable 

x

.

Содержание Tetrix Max

Страница 1: ...45292 TETRIX Tele OpControlModuleTechnicalGuide For use with SONY PS4 DUALSHOCK 4 gaming controller...

Страница 2: ...ated documentation may be reproduced in any form by any means without prior written authorization of Pitsco Inc All other product names mentioned herein might be the trademarks of their respective own...

Страница 3: ...ollers It enables tele op control of a TETRIX robot using a USB wireless input device such as a gaming controller Note that the Tele Op module ships with firmware that supports a SONY PS4 DUALSHOCK 4...

Страница 4: ...tooth signal Important Safety Information Caution Use only a TETRIX battery pack that is equipped with an in line safety fuse Failure to do so could result in damage or injury Connect the TETRIX batte...

Страница 5: ...SONY PS4 Gaming Controller Diagram SHARE OPTIONS R2 R2T L2 L2T R1 L1 TRIANGLE UP SQUARE RIGHT CIRCLE LEFT CROSS DOWN TOUCH POWER LX LY L3 push RX RY R3 push...

Страница 6: ...ETRIX Tele Op Control Module resources to view the latest activities code examples firmware updates and list of devices supported by the Tele Op module Visit Pitsco com TETRIX PRIZM Robotics Controlle...

Страница 7: ...This indicates that the PS4 controller is now in discovery mode Release the buttons 4 Press the Mode button on the Tele Op module The red LED will come on indicating that the Tele Op module is attempt...

Страница 8: ...R2T ps4 Button UP ps4 Button DOWN ps4 Button RIGHT ps4 Button LEFT ps4 Button TRIANGLE ps4 Button CROSS ps4 Button CIRCLE ps4 Button SQUARE ps4 Button SHARE ps4 Button OPTIONS ps4 Button POWER ps4 But...

Страница 9: ...if not connected Check Range Checks to see if the PS4 gaming controller Bluetooth signal is in range of the Tele Op module ps4 inRange Data Returned 0 PS4 is out of range 1 PS4 is in range void loop...

Страница 10: ...of PS4 touch pad Read Position of Data Mapped to Motor Returns the position of a PS4 controller s left and right joystick axis analog trigger buttons or pitch and roll gyro data mapped to a motor pow...

Страница 11: ...Returned None void loop ps4 getPS4 ps4 setLED RED Set the PS4 controller LED color to RED Set Rumble Speed Sets the on off and speed state of a PS4 controller s internal vibration rumble motors Rumbl...

Страница 12: ...oller USB programming port USB port for firmware updates Battery connection port Powerpole type red black connectors for connection to PRIZM 12 volt system 3 pin pin style for connection to PULSE 6 vo...

Страница 13: ......

Страница 14: ...Call Toll Free 800 835 0686 Visit Us Online at Pitsco com TETRIX Tele OpControl ModuleTechnicalGuide For use with SONY PS4 DUALSHOCK 4 gaming controller...

Отзывы: