Skip to content

Instantly share code, notes, and snippets.

Tomoatsu Shimada shimarin

Block or report user

Report or block shimarin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import os,sys,argparse
import paho.mqtt.client as mqtt
import mdns_resolver
dirname = os.path.dirname(os.path.abspath(__file__))
nodename = "unknown-node"
force_check_topic = "gearchange-force-check"
import machine,network
lan = network.LAN(id = None, mdc = machine.Pin(23), mdio = machine.Pin(18), power = machine.Pin(2), phy_addr = 1, phy_type = network.PHY_LAN8720)
shimarin / wifi-eth-bridge.c
Last active May 2, 2019
wifi eth bridge idea
View wifi-eth-bridge.c
#include <esp_private/wifi.h>
#include <netif/wlanif.h>
static esp_err_t tcpip_adapter_sta_input(void *buffer, uint16_t len, void *eb)
if (destination_mac_address_belongs_to_eth) {
esp_eth_tx(buffer, len);
return ESP_OK;
shimarin / micropython_esp32_native_memory.patch
Created Mar 21, 2019
native_memory module for MicroPython ESP32
View micropython_esp32_native_memory.patch
diff --git a/ports/esp32/Makefile b/ports/esp32/Makefile
index 36ee4b3b0..3af707a13 100644
--- a/ports/esp32/Makefile
+++ b/ports/esp32/Makefile
@@ -178,6 +178,7 @@ SRC_C = \
machine_dac.c \
machine_pwm.c \
machine_uart.c \
+ native_memory.c \
modmachine.c \
from machine import Pin,SPI
from ssd1306 import SSD1306_SPI
oled = SSD1306_SPI(128, 64, SPI(2,sck=Pin(18),mosi=Pin(23), miso=Pin(19)),dc=Pin(2),res=Pin(4),cs=Pin(5))
oled.text('Hello, World!', 0, 0)
shimarin / convert_image.c
Created Oct 29, 2018
Convert GIMP-generated 16bit image in C Source to array of uint16_t
View convert_image.c
#include <stdio.h>
#include "background.c"
int main()
const unsigned char* pt;
printf("const uint16_t background[] PROGMEM = {\n");
for (pt = gimp_image.pixel_data; pt - gimp_image.pixel_data < sizeof(gimp_image.pixel_data); pt += 2) {
printf("0x%04x,", *((unsigned short*)pt));
View ST7789.ino
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <Adafruit_GFX.h> // Core graphics library by Adafruit
#include <Arduino_ST7789.h> //
#include "edogawa_unit.h"
#include "background.h" // 背景イメージ
View bme280.cpp
#include <SPI.h>
uint16_t T1;
int16_t T2;
int16_t T3;
uint16_t P1;
int16_t P2;
int16_t P3;
shimarin /
Last active Sep 5, 2018
You can’t perform that action at this time.