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
View gearchange.py
#!/usr/bin/python2
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"
View micropython_esp32_eth.py
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)
lan.active(1)
lan.ifconfig()
@shimarin
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);
esp_wifi_internal_free_rx_buffer(eb);
return ESP_OK;
}
@shimarin
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 \
View blink.py
View esp32-micropython-ssd1306-oled.py
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)
oled.show()
@shimarin
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> //https://github.com/ananevilya/Arduino-ST7789-Library
#include "edogawa_unit.h"
#include "background.h" // 背景イメージ
View bme280.cpp
#include <SPI.h>
struct strCALIBRATION_DATA {
uint16_t T1;
int16_t T2;
int16_t T3;
uint16_t P1;
int16_t P2;
int16_t P3;
@shimarin
shimarin / 01-hoge.md
Last active Sep 5, 2018
デスクリムゾン
You can’t perform that action at this time.