Skip to content

Instantly share code, notes, and snippets.

View shimarin's full-sized avatar

Tomoatsu Shimada shimarin

View GitHub Profile
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 October 29, 2018 08:49
Convert GIMP-generated 16bit image in C Source to array of uint16_t
#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));
#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" // 背景イメージ
@shimarin
shimarin / bme280.cpp
Last active October 26, 2018 05:37
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 September 5, 2018 00:49
デスクリムゾン

あー

画像のテスト

RC_NEED="!net net.eth0"
# "usbip list -l" to see list of usb devices
AUTOBIND="2-1 2-2"
@shimarin
shimarin / hwloc-ls.md
Created February 15, 2018 22:54
Ryzen3 1200 vs Ryzen3 2200G

Ryzen3 1200

Machine (3912MB)
  Package L#0
    L3 L#0 (4096KB)
      L2 L#0 (512KB) + L1d L#0 (32KB) + L1i L#0 (64KB) + Core L#0 + PU L#0 (P#0)
      L2 L#1 (512KB) + L1d L#1 (32KB) + L1i L#1 (64KB) + Core L#1 + PU L#1 (P#1)
    L3 L#1 (4096KB)
 L2 L#2 (512KB) + L1d L#2 (32KB) + L1i L#2 (64KB) + Core L#2 + PU L#2 (P#2)
@shimarin
shimarin / nginx.conf
Created January 31, 2018 09:14
nginxでCGI
location ~ [^/]\.cgi(/|$) {
fastcgi_split_path_info ^(.+\.cgi)(/.+)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
fastcgi_pass unix:/run/fcgiwrap-nginx.socket-1;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
#!/usr/bin/python2.7
import linkcheck, linkcheck.director, linkcheck.cmdline, linkcheck.logger
class MyLogger(linkcheck.logger._Logger):
LoggerName = "my"
def start_output(self):
pass
def log_url(self, url_data):
diff --git a/sw.c.orig b/sw.c
index 43e021b..7bbe252 100644
--- a/sw.c.orig
+++ b/sw.c
@@ -387,6 +387,7 @@ static const struct usb_device_id rtl8192c_usb_ids[] = {
{RTL_USB_DEVICE(0x20f4, 0x624d, rtl92cu_hal_cfg)}, /*TRENDNet*/
{RTL_USB_DEVICE(0x2357, 0x0100, rtl92cu_hal_cfg)}, /*TP-Link WN8200ND*/
{RTL_USB_DEVICE(0x7392, 0x7822, rtl92cu_hal_cfg)}, /*Edimax -Edimax*/
+ {RTL_USB_DEVICE(0x056e, 0x4009, rtl92cu_hal_cfg)}, /*Elecom WDC-300SU2SBK*/
{}