2013-04-01から1ヶ月間の記事一覧

pywinusbの使用例

# USBDAP.py 2013/4/25 import pywinusb.hid class USBDAP: def __init__(self, pname="CMSIS-DAP"): self.dev = None for dev in pywinusb.hid.find_all_hid_devices(): if dev.product_name.find(pname) >= 0: self.dev = dev break assert(self.dev) self…

zipfileとdifflibの使用例

# mydiff.py 2013/4/19 import zipfile import difflib import os.path import sys def mydiff(fromarc, toarc, n=3): to_zip = zipfile.ZipFile(toarc) from_zip = zipfile.ZipFile(fromarc) fromto = [] for t in to_zip.namelist(): name,ext = os.path.s…

LPC1114FN28

#include "LPC11xx.h" void SystemInit() { } void wait() { __IO int i = 200000; while(i-- > 0) ; } int main() { LPC_GPIO0->DIR = 1<<7; // PIO0_7 output while(1) { LPC_GPIO0->DATA ^= 1<<7; wait(); } }