This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD | |
* | |
* SPDX-License-Identifier: Apache-2.0 | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include "esp_err.h" | |
#include "esp_log.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Try it out by opening https://ide.kaitai.io/ and copying this file there | |
# Based on an article by @angelcarve about ESP8266 binary image parsing with Kaitai Struct: | |
# https://carvesystems.com/news/parsing-binaries-with-kaitai-struct/ | |
meta: | |
id: esp | |
file-extension: bin | |
endian: le | |
seq: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include "driver/adc.h" | |
#include "driver/gpio.h" | |
#include "driver/rtc_io.h" | |
#include "soc/cpu.h" | |
const char* names[] = {"D2", "D3", "CLK", "CMD", "D0", "D1"}; | |
const int pins[] = {12, 13, 14, 15, 2, 4}; | |
const int adc_channels[] = {5, 4, 6, 3, 2, 0}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ESP32-S2 (beta) "dedicated GPIO" peripheral example */ | |
#include <stdio.h> | |
#include "sdkconfig.h" | |
#include "soc/system_reg.h" | |
#include "esp32s2beta/rom/gpio.h" | |
#include "soc/gpio_sig_map.h" | |
#include "driver/gpio.h" | |
/* The header file is not yet in IDF; however this is the only register we need. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <time.h> | |
#include <sys/time.h> | |
#include <assert.h> | |
static time_t get_tz_offset(time_t now) { | |
struct tm local, utc; | |
localtime_r(&now, &local); |
NewerOlder