3.0.0 • Published 5 years ago

@scarygami/giiker v3.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

giiker

JavaScript wrapper for GiiKER smart cube Bluetooth API

Usage

import GiiKER from '@scarygami/giiker';

// Note: To use Web Bluetooth API trigger action such as button click is required
const button = document.querySelector('button#connect');
button.addEventListener('click', async () => {
	const giiker = await GiiKER.connect();
	giiker.on('move', (move) => {
		console.log(move.face); //=> "F"
		console.log(move.amount); //=> -1
		console.log(move.notation); //=> "F'"
	});
})