Skip to content

Instantly share code, notes, and snippets.

@SisyamoNeko
SisyamoNeko / CV2Neck.py
Last active October 20, 2019 03:19
OpenCVを使ったこっちをジロジロ見てくるロボの頭用 2pieces_Servo2とセット
#!/usr/bin/env python3
import serial
import serial.tools.list_ports
import numpy as np
import cv2
import os
from time import sleep
class Main():
def __init__(self):
@SisyamoNeko
SisyamoNeko / 2pieces_Servo2
Last active October 20, 2019 03:19
VarSpeedServo.hを用いた任意のサーボ制御用 CV2Neck.pyとセット
#include <String.h>
#include <VarSpeedServo.h>
VarSpeedServo sv1;
VarSpeedServo sv2;
String PTangle, kari;
unsigned int ang, sp = 20;
unsigned long count = 18000000;
void setup() {
Serial.begin(115200);
@SisyamoNeko
SisyamoNeko / 2pieces_servo
Created October 1, 2019 09:42
arduinoに繋いだ複数のサーボのうち任意のヤツを動かすsketch 雛形
#include <String.h>
#include <Servo.h>
Servo sv1;
Servo sv2;
String PTangle, kari;
unsigned int ang;
void setup() {
Serial.begin(9600);
pinMode(13, OUTPUT);
@SisyamoNeko
SisyamoNeko / waterlevel_alarm
Created March 23, 2019 16:30
LineNotifyと連携したお風呂警報機
#!/usr/bin/python3
# _*_ coding: utf-8 _*_
import time
import RPi.GPIO as G
import requests
import subprocess
print("now starting")
line_url = 'https://notify-api.line.me/api/notify'
@SisyamoNeko
SisyamoNeko / water_temp.py
Created January 9, 2019 02:14
DS18B20で水温取得と SQlite3 + Bokeh + Flask でグラフ描画
#!/usr/bin/env python3
# _*_ coding: utf-8 _*
import subprocess
import time, signal, sys
import sqlite3
import datetime
from bokeh.plotting import figure, output_file, show
import contextlib
@SisyamoNeko
SisyamoNeko / main.py
Last active November 29, 2018 13:09
シューティングゲームおしめちゃん
#!/usr/bin/env python
#coding: utf-8
import pygame
from pygame.locals import *
import os
import math
import random
import sys
SCR_RECT = Rect(0,0,800,600)