Limited record: this part has neither specifications nor a datasheet in the catalog yet. It is shown for reference and is not indexed.

STK-01 – Joystick STK-01

Joystick

Maker, Prototyping, Open-Hardware & Developer Boards

Manufacturer part number
STK-01
Manufacturer
FriendlyElec

FriendlyElec STK-01, listed under “Maker, Prototyping, Open-Hardware & Developer Boards”.

Product overview

Joystick STK-01

0 reviews / Write a review

(USD)

Buyer responsible for payment of duty.

Brand: FriendlyElec

Product Code: STK-01

Qty:

Description

Reviews (0)

1 Introduction

This module consists of two Sliding rheostats and one button. When you move the joystick the sliding rheostats' resistance will change and the corresponding x/y values will change too. When you push the joystick the SW level will turn low.

2 Features

two sliding rheostat and one button

2.54mm spacing pin

3 How To

Connect to Tiny4412 SDK (1506) 1) Please connect the Tiny4412 SDK to Matrix - Analog to Digital Converter

2) Please connect the Joystick to Matrix - Analog to Digital Converter:

GND to ground

V to 5V

VRX to Analog to Digital Converter's AIN0

VRY to Analog to Digital Converter's AIN1

SW to Analog to Digital Converter's AIN2

Code Sample in C Under Linux

#include <stdio.h> #include <unistd.h> #include <signal.h> #include <stdlib.h> #include "libfahw.h" #define SW_TRIGGER (5) #define PS2_READ_TIMES (10) static int devFD; void PS2Handler ( int signNum ) { if ( signNum == SIGINT ) { printf ( "Quit reading PS2 rocker " ); pcf8591DeInit ( devFD ); } exit ( 0 ); } int main ( int argc, char ** argv ) { int mode = 0x0; if ( ( devFD = pcf8591Init ( ) ) == - 1 ) { printf ( "Fail to init pcf8591 AD " ); return - 1; } if ( pcf8591SetCtrl ( devFD, PCF8591_INIT_AD_CONTROL ) == - 1 ) { printf ( "Fail to Set pcf8591 control AD " ); pcf8591DeInit ( devFD ); return - 1; } int i = 0; int x, y, z; signal ( SIGINT, PS2Handler ); for ( i = 0; i < PS2_READ_TIMES; i ++ ) { x = pcf8591Read ( devFD, mode, PCF8591_AIN_CHANNEL0 ); y = pcf8591Read ( devFD, mode, PCF8591_AIN_CHANNEL1 ); z = pcf8591Read ( devFD, mode, PCF8591_AIN_CHANNEL2 ); if ( z > SW_TRIGGER ) { z = 0; } else { z = 0; } else { z = 1; } printf ( "X=%3d Y=%3d Z=%d ", x, y, z ); sleep ( 1 ); } pcf8591DeInit ( devFD ); return 0; } Compile and Run

git clone http: // github.com / friendlyarm / fa-hardware.git cd fa-hardware cd demo cd matrix-joystick make Copy your compiled bin to your board and you are ready to go.

Resources

Write a review

Write a review

Your Name

Your Review

Note: HTML is not translated!

Rating Bad

Good

Enter the code in the box below

Continue

Copyright © 2008-2026 friendlyelec.com All rights reserved.

Top

Categories

CPU Module (11)

Mini Board (3)

NanoPC & NanoPi (31)

Hats & Docks (12)

Enclosure & Holder (17)

BakeBit Sensors/Modules (2)

Matrix Accessories (71)

LCD Module (17)

Value Pack & Kit (11)

See also

Technical questions

Ask a question

No published question about this part yet. Questions are reviewed before publication.

Request a quote