Skip to content

Instantly share code, notes, and snippets.

@pklazy
pklazy / nsx-39_test.py
Last active August 29, 2015 14:01
NSX-39 테스트
# coding=utf-8
import pygame.midi as pm
import time
if __name__ == '__main__':
pm.init()
mo = None
mi = None
for i in range(pm.get_count()):
@pklazy
pklazy / recodrdTest.py
Created May 21, 2014 16:26
만들어진 파일은 'aplay -r 44100 -f S16_LE -c 1 test.raw'로 재생.
import time
import alsaaudio
f = open('test.raw', 'wb')
card = alsaaudio.cards()[1]
inp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, alsaaudio.PCM_NONBLOCK, card)
inp.setchannels(1)
inp.setrate(44100)
inp.setformat(alsaaudio.PCM_FORMAT_S16_LE)
inp.setperiodsize(160)
@pklazy
pklazy / PKGBUILD
Created February 27, 2015 12:35
raspberrypi archlinuxarm 3.18.7-9 rt patch
# Maintainer: Dave Higham <pepedog@archlinuxarm.org>
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
# Maintainer: Oleg Rakhmanov <oleg@archlinuxarm.org>
# NOTE: Packages replace linux-raspberrypi-latest, remove if that package comes back
buildarch=20
pkgbase=linux-raspberrypi
_commit=11f2a1f8db91523fbcf10f8428f407cf3b37f936
CROSS_COMPILE = arm-none-eabi-
TOOLCHAIN_LIBS = gcc
LIBGCC_DIR = $(shell dirname `$(CROSS_COMPILE)gcc ${KBUILD_CFLAGS} -print-libgcc-file-name`)
LIB_INCLUDE_DIR += -L ${LIBGCC_DIR}
TOOLCHAIN_CFLAGS = -I/usr/lib/arm-none-eabi/include
DTC ?= /usr/bin/dtc
/dts-v1/;
/plugin/;
#include <dt-bindings/input/input.h>
/{
compatible = "brcm,bcm2708";
fragment@0 {
target = <&i2c1>;

라즈베리 파이 python3.7 빌드 기록

sudo apt build-dep python3
sudo apt install libffi-dev libssl-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libexpat1-dev
git clone https://github.com/python/cpython
cd cpython
git checkout v3.7.0
./configure --enable-optimizations --with-lto --prefix=$HOME/python37
make -j4

라즈베리 파이에서 can-isotp 설치 기록

git clone https://github.com/hartkopp/can-isotp.git
cd can-isotp
sudo apt install raspberrypi-kernel-headers
make
sudo make modules_install
sudo depmod -a
rz > /dev/ttyUSB0 < /dev/ttyUSB0
sz filename > /dev/ttyUSB0 < /dev/ttyUSB0
// SPDX-License-Identifier: GPL-2.0+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <video/mipi_display.h>
#include "fbtft.h"
#define DRVNAME "fb_st7789vw"
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";