Skip to content

Instantly share code, notes, and snippets.

View abuvanth's full-sized avatar

Syed abuvanth

View GitHub Profile
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/Welcome4",
"definitions": {
"Welcome4": {
"type": "object",
"additionalProperties": false,
"properties": {
"dht": {
"$ref": "#/definitions/Dht"
@abuvanth
abuvanth / esp32-cyberfly.py
Created October 22, 2023 04:54
Control esp32 onboard LED using Cyberfly IoT platform
from data_shipper import CyberflyDataShipper
import machine
import time
key_pair = {"publicKey":"37a720dcf056387df1d9c85cda3cbff55aa9084b6eaee8bb9fde20c684fd9418","secretKey":"f18adeab3f38b5531f6fcd9ae05d3fb0ea42f0314ea5b93f0d7114d14ff3daac"}
device_id="0afcff85-5b57-4136-aa6c-2897cc5b6b88"
client = CyberflyDataShipper(device_id=device_id, key_pair=key_pair, ssid="Abu",wifi_password="abu12345678", network_id="testnet04")
@client.on_message()
from machine import Pin, SoftSPI
from sx127x import SX127x #https://github.com/abuvanth/micropython-sx127x/blob/master/sx127x.py
import neopixel
from time import sleep
# Define the pins (adjust based on your ESP32 board and wiring)
MOSI_PIN = 4
MISO_PIN = 0
SCK_PIN = 1
NSS_PIN = 5
from machine import Pin, SPI
from sx127x import SX127x #https://github.com/abuvanth/micropython-sx127x/blob/master/sx127x.py
import time
import neopixel
# Define the pins (adjust based on your ESP32 board and wiring)
MOSI_PIN = 4
MISO_PIN = 0
SCK_PIN = 1
NSS_PIN = 5
DIO0_PIN = 10
@abuvanth
abuvanth / crypto_price_widget.js
Created February 8, 2024 12:01
scriptable ios widget for showing cyberfly price in ios home
const params = args.widgetParameter ? args.widgetParameter.split(",") : [];
const isDarkTheme = params?.[0] === 'dark';
const padding = 2;
const widget = new ListWidget();
if (isDarkTheme) {
widget.backgroundColor = new Color('#1C1C1E');;
}
widget.setPadding(padding, padding, padding, padding);