top of page

Encoder Usage





 

The GPIO 1 (IO_1) pin of Airhmi displays can also be used as an encoder. 

 

Encoders are commonly used in servo motors, robots, motion cameras, CNC machines and automation systems.

 

Encoders are divided into two basic types:

 

Linear Encoder: Used in linear moving systems.

 

Rotary Encoder: Used in systems with circular motion.


 

Read Function

It calculates the number of encoder pulses per second and gives it to you as an integer.


 GPIO1_EncoderGet();

Sample Code

Displaying the read encoder value on the label on the screen.

#include "stk.h"



int t = GPIO1_EncoderGet();

LabelSeti("ELabel1" , t ); 

*** Note: You need to upload the font file in the project folder to windows. When you double click on it, click the install button in the window that opens.

You should also install it in your Airhmi editor. Go to font from the Options section and do your installation from there.

 



 

Download








10 views0 comments

Recent Posts

See All

Comments


bottom of page