Skip to content

Instantly share code, notes, and snippets.

View squirelo's full-sized avatar
💭
Currently entertaining

Valentin Squirelo squirelo

💭
Currently entertaining
View GitHub Profile
A
Add
AudioForward
AudioMute
AudioNext
AudioPause
AudioPlay
AudioPrev
AudioRandom
AudioRepeat
'use client';
/* eslint-disable indent */
import React from "react";
import useWindowSize from "@/hooks/use-spatial-navigation/useWindowSize";
import getScaledSize from "@/hooks/use-spatial-navigation/getScaledSize";
import { useGestureRecognizer } from "use-mediapipe";
import useCamera from "@/hooks/use-spatial-navigation/useCamera";
import { drawHandsWithKeyLandmarks } from "@/hooks/use-spatial-navigation/drawHands";
import { Button } from 'react-daisyui';

Event-Driven JSON Structure Documentation

This document outlines the structure and types of events transmitted in the event-driven JSON format for gamepad, keyboard, and mouse inputs.

Example JSON Event Message

{
  "events": [
 {"type": "gamepadButton", "button": "A", "state": true},
@squirelo
squirelo / gist:1f1e0103f35aa39ca7cbc5ecd9c4ef66
Created July 24, 2023 20:58
Face Landmarks Definitions
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@squirelo
squirelo / blemouse.ino
Created April 26, 2023 18:55
wheelchair bluetooth demo
#include <BleMouse.h> // Include the bleMouse library
BleMouse bleMouse;
const int joystickXPin = 26; // Pin for the X-axis of the joystick
const int joystickYPin = 36; // Pin for the Y-axis of the joystick
const int toggleButtonPin = 27; // Pin for the toggle button
const int sensitivity = 10; // Sensitivity for mouse movements
#include <BleMouse.h> // Include the bleMouse library
#include "Adafruit_TinyUSB.h" // Include the Adafruit TinyUSB library
BleMouse bleMouse;
uint8_t const desc_hid_report[] = {TUD_HID_REPORT_DESC_MOUSE()};
Adafruit_USBD_HID usbMouse(desc_hid_report, sizeof(desc_hid_report), HID_ITF_PROTOCOL_MOUSE, 2, false);
const int joystickXPin = 26; // Pin for the X-axis of the joystick
const int joystickYPin = 36; // Pin for the Y-axis of the joystick
const int joystickButtonPin = 2; // Pin for the joystick button
#include <TinyUSB_Mouse_and_Keyboard.h> // Include the TinyUSB_Mouse_and_Keyboard library
const int joystickXPin = A0; // Pin for the X-axis of the joystick
const int joystickYPin = A1; // Pin for the Y-axis of the joystick
const int joystickButtonPin = 2; // Pin for the joystick button
const int sensitivity = 5; // Sensitivity for mouse movements
int xValue = 0; // Value for the X-axis of the joystick
int yValue = 0; // Value for the Y-axis of the joystick
@squirelo
squirelo / gattc & gatts arduino esp32.ino
Last active March 7, 2023 15:00
This code creates a GATT server and a GATT client on separate FreeRTOS tasks, and runs them on different cores of the ESP32. The GATT server exposes a characteristic that can be read and written by the GATT client. The GATT client scans for the server, connects to it, and writes a new value to the characteristic every second. Note that you'll ne…
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include <BLE2902.h>
// Define UUIDs for our service and characteristics
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"
// Define the GATT server and client objects
@echo off
echo %1 | ncat -u 192.168.3.240 8888
#define SPEED 85
#define TURN_SPEED 90
#define SHIFT_SPEED 130
#define MOVE_DELAY 500
#define TURN_TIME 500
#define MOVE_TIME 500
#define speedPinR 9 // Front Wheel PWM pin connect Model-Y M_B ENA