Skip to content

GameControllerizer/GcOpsJs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GcOpsJs

node.js interface for G.C. H/W gamepad emulator.

Overview

G.C. H/W gamepad emulator can be controlled from not only GUI programming environment (e.g. Makecode, Node-RED), but also program. This repository contains node.js sample codes.

There are two methods,

  1. Network access
  2. Direct access

1. Network access

This method is best for easy-to-use system.

Requirements

H/W

S/W

node-red-contrib-game_controllerizer is the library for Node-RED basically. But, programmer can call inner functions of the library directly.

Step-1. H/W setup

Setup G.C. H/W emulator and RasPi kit. See node-red-contrib-game_controllerizer library page. After the Node-RED is running on RasPi, import chearsheet as predefined Node-RED flow.

Step-2. Run an example code

# clone this repository
% git clone https://github.com/GameControllerizer/GcOpsJs
% cd GcOpsJs
# setup libraries
% npm i serialport
% npm i node-red-contrib-game_controllerizer
% npm i websocket
# run an example code
% node -v
v8.10.0
# !!! Do not forget to configure websocket port & host defined in the example code !!!
% node example_network.js

When the program is runnning, the marker of ws:/gamepad node in MISC tab must be green as followed.


2. Direct access

This method is best for low latency system.

Requirements

H/W

S/W

same as 'Network access'

Step-1. H/W setup

Step-2. Run an example code

# clone this repository
% git clone https://github.com/GameControllerizer/GcOpsJs
% cd GcOpsJs
# setup libraries
% npm i serialport
% npm i node-red-contrib-game_controllerizer
# run an example code
% node -v
v8.10.0
# !!! Do not forget to configure serialport name defined in the example code !!!
% node example_direct.js

Note

All the programmer have to do is call GcOps.toBytes() function to convert JSON based command list into bytes. Check DSL4GC for command format.

About

NodeJs interface for GC H/W gamepad emulator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •