Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
static void set_time(void);
static void get_time(void);
void app_main(void)
{
@igrr
igrr / makehex.py
Created January 13, 2023 16:17
create an intel hex file from IDF build directory
#!/usr/bin/env python
import intelhex
import json
from pathlib import Path
def main():
build_dir = Path('build')
if not build_dir.exists() or not build_dir.is_dir():
print('build directory doesn\'t exist')
#include <Servo.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
const char* ssid = "your-ssid";
const char* pass = "your-password";
ESP8266WebServer server(80);
Servo myservo;
@igrr
igrr / esp32c3_gpio_interrupt.c
Created May 3, 2022 18:53 — forked from ermacv/esp32c3_gpio_interrupt.c
Code to reproduce "interrupt is not triggered during the light sleep" on ESP32-C3 (updated)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "driver/gpio.h"
#include "esp_pm.h"
#include "esp_log.h"
#include "esp_sleep.h"
@igrr
igrr / ESP8266httpsUpdate.ino
Last active October 30, 2022 14:18
ESP8266 ota over HTTPS
/*
OTA update over HTTPS
As an example, we download and install ESP8266Basic firmware from github.
Requires latest git version of the core (November 17, 2015)
Created by Ivan Grokhotkov, 2015.
This example is in public domain.
*/
@igrr
igrr / tlc5947.py
Created December 2, 2021 21:03
MicroPython module for the TLC5947 (untested)
# SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries
#
# SPDX-License-Identifier: MIT
#
# MicroPython module for the TLC5947 12-bit 24 channel LED PWM driver.
# Based on CircuitPython version of the same by Tony DiCola, Walter Haschka.
#
from machine import Pin, SPI
@igrr
igrr / mh-z14.ino
Created December 25, 2015 11:42
MH-Z14 ESP8266 Arduino example
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <time.h>
const char* ssid = "co2_sensor";
const char* password = "1qazxsw2";
ESP8266WebServer server(80);
@igrr
igrr / idos.py
Last active July 13, 2021 19:25 — forked from grafuls/idos.py
python script for getting time left for next bus with idos(Brno)
from bs4 import BeautifulSoup as bs
from dateutil import parser
from datetime import datetime
import requests
import re
# search for all buses leaving from one station in any direction
URL = 'http://jizdnirady.idnes.cz/brno/odjezdy/?f=cervinkova&fc=302003&lng=E&submit=true'
@igrr
igrr / OTATest.ino
Created June 11, 2015 15:24
ESP8266 Arduino OTA example v1
#include <ESP8266WiFi.h>
#include <WiFiUDP.h>
const char* ssid = "..........";
const char* password = "...........";
WiFiUDP listener;
void setup() {
Serial.begin(115200);
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
const char* ssid = "..............";
const char* password = "................";
String form = "<form action='led'><input type='radio' name='state' value='1' checked>On<input type='radio' name='state' value='0'>Off<input type='submit' value='Submit'></form>";
String imagepage = "<img src='/led.png'>";