Giter VIP home page Giter VIP logo

zhousensorio's Introduction

ZhouSensorIO

简单的大四游戏控制器IO库,支持多个进程同时访问手台,并针对这一使用场景进行了简单的优化。

如何使用

链接 ZhouSensorLib 并引用头文件 sensor.h , 之后可参考 ZhouSensorTest 项目中的代码来编写。

开发指北

首先需要调用 sensor_start(); 进行初始化,之后便可对手台进行操作。

交互相关

SENSOR_API uint8_t sensor_get_ir(int fix); 获取IR,参数中的 fix 为是否对或得到的数据进行修正。

SENSOR_API uint8_t sensor_get_buttons(); 获取按键状态。

SENSOR_API void sensor_get_touch(uint8_t* buffer); 获取触摸板状态,需要传入一个 uint8_t[32] 数组。

SENSOR_API void sensor_set_color(uint8_t* color); 设置触摸板颜色,需要传入一个 uint8_t[96] 数组,内部有对于颜色的压缩处理。

读卡器相关

SENSOR_API uint8_t sensor_get_card_statue(); 获取读卡器状态。

SENSOR_API void sensor_set_card_led(uint8_t r, uint8_t g, uint8_t b); 设置读卡器LED颜色。

SENSOR_API HRESULT sensor_get_****_id(***); 尝试读取指定类型的卡。

SENSOR_API void sensor_set_sensitivity(uint8_t sensitivity) 设置手台灵敏度,默认为1。

程序结构

当调用 sensor_start(); 时,会尝试连接到已经启动的手台 Host ,若未连接成功则会尝试创建新的 Host 。不同进程之间采用共享内存访问手台状态,包括读卡器,IR以及触摸板,未作同步处理。 Host 相关代码在 Host.c 中。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.