This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import minimalmodbus | |
from serial.tools import list_ports | |
for d in list_ports.comports(): | |
if d.description.startswith('USB Serial'): | |
device = d.device | |
class RM_PP03: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bitstring | |
import collections | |
from crccheck.crc import Crc16Genibus | |
import re | |
f = open("../result_r_y_yg_nobori2-3.bin", "rb").read() | |
b = bitstring.BitArray(bytes=f) | |
r = re.compile('0x(7e.+7e)$') | |
def check(b): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bitstring | |
import collections | |
f = open("result.bin", "rb").read() | |
b = bitstring.BitArray(bytes=f) | |
def check(b): | |
l = [] | |
for i in b.findall("0x7E"): | |
if str(b[i+72:i+80]) == '0x7e': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
#coding:utf-8 | |
#require bitstring | |
import bitstring | |
import math | |
import sys | |
filename = sys.argv[1] | |
packet_length = 188 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
#coding:utf-8 | |
#require bitstring | |
import bitstring | |
from sys import argv | |
import math | |
import sys | |
import io | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
#coding:utf-8 | |
#require bitstring | |
import bitstring | |
import math | |
import sys | |
filename = sys.argv[1] | |
packet_length = 188 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import Pin, PWM | |
from time import sleep | |
pwm = PWM(Pin(15)) | |
# 80kHz | |
pwm.freq(80000) | |
pwm.duty_u16(0) | |
line = "" | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
# サンイン重工 OHC-PC01AコントローラからPythonへ繋ぎこむライブラリ | |
import pygame | |
import time | |
class OHC_PC01A: | |
def __init__(self): | |
pygame.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:utf-8 | |
import serial | |
import time | |
def send(s, value): | |
s.write(value.encode('ascii') + b'\n') | |
s.flush() | |
def init_dsair2(s): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function retribeXMLs() | |
{ | |
var xmls = []; | |
var messages; | |
var zipblob; | |
var fileblob; | |
// 2日以内のすべてのスレッドを取得 | |
var threads = GmailApp.search('newer_than:2d'); | |
NewerOlder