Skip to content

Instantly share code, notes, and snippets.

@sivar2311
sivar2311 / BLE-Keyboard.ino
Created August 21, 2021 06:39
SinricPro BLE Keyboard example
/*
* Required libraries and their dependencies:
*
* SinricPro (https://github.com/sinricpro/esp8266-esp32-sdk)
* -> WebSockets (https://github.com/Links2004/arduinoWebSockets)
* -> ArduinoJson (https://github.com/bblanchon/ArduinoJson)
*
* ESP32-NimBLE-Keyboard (https://github.com/sivar2311/ESP32-NimBLE-Keyboard)
* -> NimBLE-Arduino (https://github.com/h2zero/NimBLE-Arduino)
*/
@sivar2311
sivar2311 / main.cpp
Last active October 1, 2021 17:11
Keyboard layouts
#include <Arduino.h>
#include <map>
using KbdLayout = std::map<uint8_t, uint8_t>;
// standard US layout
#define SHIFT 0x80
KbdLayout std_layout{
{0x08, 0x2a}, // BS Backspace
{0x09, 0x2b}, // TAB Tab
@sivar2311
sivar2311 / RGB_LED_Stripe_5050.ino
Last active October 4, 2021 19:43
RGB_LED_Stripe_5050
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <SinricPro.h>
#include <SinricProLight.h>
#include <map>
#define WIFI_SSID "YOUR-WIFI-SSID"
#define WIFI_PASS "YOUR-WIFI-PASS"
#define APP_KEY "YOUR-APPKEY" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"
@sivar2311
sivar2311 / MotorEncoder.cpp
Created July 2, 2023 16:04
MotorEncoder Library
#include <Arduino.h>
#include "MotorEncoder.h"
MotorEncoder::MotorEncoder(int motorPinA, int MotorPinB, int encoderPin)
: motorPinA(motorPinA)
, motorPinB(motorPinB)
, encoderPin(encoderPin) {
pinMode(motorPinA, OUTPUT);
pinMode(motorPinB, OUTPUT);
pinMode(encoderPin, INPUT);
@sivar2311
sivar2311 / BLEDeviceCounter.h
Created September 24, 2023 18:56
SinricPro BLE Device Counter
#ifndef _BLEDEVICECOUNTER_H_
#define _BLEDEVICECOUNTER_H_
#include <SinricProDevice.h>
#include <Capabilities/RangeController.h>
class BLEDeviceCounter
: public SinricProDevice
, public RangeController<BLEDeviceCounter> {
friend class RangeController<BLEDeviceCounter>;
@sivar2311
sivar2311 / platform-espressif32-versions.md
Last active March 29, 2025 05:41
platform-espressif32 versions

Arduino 3.x

Arduino 3.x is not officially suported by PlatformIO - see platformio/platform-espressif32#1225

Due to the lack of further development of the Espressif 32 Arduino Core for PlatformIO, the pioarduino fork was created.

Arduino 3.2.x

platform-espressif32 Arduino Core based on ESP-IDF platformio.ini