Skip to content

Instantly share code, notes, and snippets.

cmake_minimum_required(VERSION 3.1)
project(samples)
add_subdirectory(func)
add_executable(main main.c)
# Install target
install(TARGETS main
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/
)
cmake_minimum_required(VERSION 3.1)
project(func)
add_library(func func.c)
cmake_minimum_required(VERSION 3.1)
project(samples)
add_executable(main main.c)
install(TARGETS main
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/
)
cmake_minimum_required(VERSION 3.1)
project(samples)
add_executable(main main.c)
cmake_minimum_required(VERSION 3.1)
add_subdirectory(src)
#include <stdio.h>
#include "esp_log.h"
#include "driver/i2c.h"
#include "sdkconfig.h"
static const char *TAG = "sht31 example";
static i2c_port_t i2c_port = I2C_NUM_0;
#define I2C_MASTER_TX_BUF_DISABLE 0
#define I2C_MASTER_RX_BUF_DISABLE 0
def mobilenet(inputs):
mobilenet_conv_defs = [
{"kernel": [3, 3], "stride": 1, "depth": 64},
{"kernel": [3, 3], "stride": 2, "depth": 128},
{"kernel": [3, 3], "stride": 1, "depth": 128},
{"kernel": [3, 3], "stride": 2, "depth": 256},
{"kernel": [3, 3], "stride": 1, "depth": 256},
{"kernel": [3, 3], "stride": 2, "depth": 512},
{"kernel": [3, 3], "stride": 1, "depth": 512},
{"kernel": [3, 3], "stride": 1, "depth": 512},
@sepfy
sepfy / LibusbSerial.py
Created August 21, 2019 06:20
pyusb (libusb) connect to CDC device
import usb.core
import usb.util
import usb.control
import time
import array
import json
# Test by Arduino
VENDER = 0x2341
@sepfy
sepfy / build-armhf-fs.sh
Last active June 27, 2019 09:31
Construct a debian rootfs
#/bin/bash
apt-get install binfmt-support qemu qemu-user-static debootstrap
debootstrap --foreign --arch armhf stretch rootfs http://ftp.debian.org/debian/
cp /usr/bin/qemu-arm-static rootfs/usr/bin
sudo chroot rootfs
LC_ALL=C LANGUAGE=C LANG=C chroot . /debootstrap/debootstrap --second-stage
@sepfy
sepfy / lora_play.c
Created May 3, 2019 07:38
Study LoraWAN
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Ref:
// https://www.eebreakdown.com/2017/01/lora-ii.html
// https://lora-alliance.org/sites/default/files/2018-07/lorawan1.0.3.pdf
typedef struct _Personalized {
// DevEUI: 64 bit -> Static
unsigned char DevEUI[8];
// AppEUI: 64 bit -> Static