Skip to content

Instantly share code, notes, and snippets.

View elliotwoods's full-sized avatar

Elliot Woods elliotwoods

View GitHub Profile
@elliotwoods
elliotwoods / i2c_scanner.cpp
Created August 23, 2023 03:49
I2C Scanner for Portal
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
@elliotwoods
elliotwoods / etherdream.cpp
Created August 9, 2016 06:07
Etherdream cross-platform (C++11)
/* Ether Dream interface library
*
* Copyright 2011-2012 Jacob Potter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of either the GNU General Public License version 2
* or 3, or the GNU Lesser General Public License version 3, as published
* by the Free Software Foundation, at your option.
*
* This program is distributed in the hope that it will be useful,

Introduction

We use:

  • The ES32 microcontroller hardware
  • The ESP-IDF toolchain
  • The MicroPython framework / environment

And generally we are building in a Windows environment. The following document is a guide on how to get Muscle Memory firmware building to a firmware.bin file which can be uploaded to the ESP32.

Introduction

We use:

  • The ES32 microcontroller hardware
  • The ESP-IDF toolchain
  • The MicroPython framework / environment

And generally we are building in a Windows environment. The following document is a guide on how to get Muscle Memory firmware building to a firmware.bin file which can be uploaded to the ESP32.

#define __P(protos) protos /* full-blown ANSI C */
^
../../lib/berkeley-db-1.xx/btree/btree.h:283:2: error: unknown type name 'recno_t'
recno_t rcursor; /* R: recno cursor (1-based) */
^
../../lib/berkeley-db-1.xx/btree/btree.h:127:2: error: unknown type name 'pgno_t'
pgno_t pgno; /* page number stored on */
^
../../lib/berkeley-db-1.xx/btree/btree.h:126:2: error: unknown type name 'u_int32_t'
u_int32_t ksize; /* key size */
kimchips@KC41-VIDEOSERVER:/mnt/c/dev/micropython-wrap$ make MICROPYTHON_PORT_DIR=/mnt/c/dev/micropython/ports/esp32 sharedlib
make -C /mnt/c/dev/micropython/ports/esp32 BUILD=build MICROPY_PY_BTREE=0 MICROPY_PY_FFI=0 MICROPY_PY_USSL=0 MICROPY_PY_AXTLS=0 MICROPY_FATFS=0 MICROPY_PY_THREAD=0 build/genhdr/qstrdefs.generated.h
make[1]: Entering directory '/mnt/c/dev/micropython/ports/esp32'
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Building with ESP IDF v4
fatal: No names found, cannot describe anything.
make[1]: Leaving directory '/mnt/c/dev/micropython/ports/esp32'
g++ -fPIC -Wall -Werror -I../micropython -I../micropython/py -I/mnt/c/dev/micropython/ports/esp32 -I/mnt/c/dev/micropython/ports/esp32/build -I/mnt/c/dev/micropython/ports/esp32/boards/generic -I/mnt/c/dev/esp-idf/components/esp32/include -I/mnt/c/dev/esp-idf/components/esp_rom/include -I/mnt/c/dev/esp-idf/components/freertos/include -I/mnt/c/dev/esp-idf/components/newlib/include -I/mnt/c/dev/esp-idf/component
@elliotwoods
elliotwoods / oled.py
Created November 18, 2019 07:30
code for managing ssd1306 OLED on ESP32 with micropython on a TTGO OLED board
from machine import Pin, I2C
import ssd1306
import time
import esp32
def farenheit_to_celcius(farenheit_value):
return (farenheit_value - 32) * 5 / 9
class Oled:
def __init__(self, reset = 16, scl = 15, sda = 4):
This file has been truncated, but you can view the full file.
0000000000795f70 T __Z7toupperi
0000000000873650 D __ZGVZN5Eigen8internal20manage_caching_sizesENS_6ActionEPlS2_S2_E12m_cacheSizes
0000000000006d40 T __ZN13LoggerVoidifyanERKNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE
000000000000ccf0 T __ZN13MessageLogger10LogToSinksEi
000000000000cf10 T __ZN13MessageLogger12WaitForSinksEv
000000000000aaa0 T __ZN13MessageLogger13StripBasenameERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPS6_
0000000000006de0 T __ZN13MessageLogger6streamEv
0000000000015830 T __ZN5Eigen10MatrixBaseINS_3MapIKNS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEE5arrayEv
000000000071d540 T __ZN5Eigen10MatrixBaseINS_3MapIKNS_6MatrixIdLin1ELin1ELi1ELin1ELin1EEELi0ENS_6StrideILi0ELi0EEEEEE15selfadjointViewILj2EEENS8_25SelfAdjointViewReturnTypeIXT_EE4TypeEv
00000000001c8e60 T __ZN5Eigen10MatrixBaseINS_3MapINS_6MatrixIdLi1ELi1ELi1ELi1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEE7noaliasEv
vector<aruco::Marker> findMarkersMultiCrop(aruco::MarkerDetector & markerDetector, const cv::Mat & image, int cropIterations, float overlap) {
auto imageWidth = image.cols;
auto imageHeight = image.rows;
map<int, aruco::Marker> markersInAllCrops;
for (int cropIteration = 0; cropIteration < cropIterations; cropIteration++) {
auto stepRatio = 1.0f / pow(2, cropIteration);
@elliotwoods
elliotwoods / UnsafeGenericFileResponse.cs
Created May 29, 2018 11:44
Allow unsafe file requests
namespace Nancy.Responses
{
using System;
using System.IO;
using System.Linq;
using Nancy.Configuration;
using Nancy.Helpers;
/// <summary>
/// A response representing a file.