Skip to content

Instantly share code, notes, and snippets.

View oklahomer's full-sized avatar
🏠
Working from home

Go HAGIWARA / 萩原 豪 oklahomer

🏠
Working from home
View GitHub Profile
@oklahomer
oklahomer / picamera_overlay.py
Last active August 29, 2015 14:06
Testing some features that were introduced in picamera ver. 1.8.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import picamera
import sys
import os
import time
from PIL import Image, ImageDraw, ImageFont
try:
--- /etc/modprobe.d/adafruit.conf.20140824 2014-08-24 05:27:23.259413221 +0000
+++ /etc/modprobe.d/adafruit.conf 2014-08-24 05:28:27.258765162 +0000
@@ -1 +1,2 @@
options fbtft_device name=adafruitts rotate=90 frequency=32000000
+options rpi_power_switch gpio_pin=18 mode=0
pi@raspberrypi ~ $ sudo apt-get install gpsd gpsd-clients python-gps
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libgps20 python-cairo python-gobject-2 python-gtk2
Suggested packages:
python-gobject-2-dbg python-gtk2-doc
The following NEW packages will be installed:
gpsd gpsd-clients libgps20 python-cairo python-gobject-2 python-gps python-gtk2
--- /boot/cmdline.txt.20140720 2014-07-19 15:20:01.000000000 +0000
+++ /boot/cmdline.txt 2014-07-19 15:20:47.000000000 +0000
@@ -1 +1 @@
-dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
+dwc_otg.lpm_enable=0 rpitestmode=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
--- /etc/inittab.20140720 2014-07-19 15:27:14.575100326 +0000
+++ /etc/inittab 2014-07-19 15:27:54.784636660 +0000
@@ -69,4 +69,4 @@
#Spawn a getty on Raspberry Pi serial line
-T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
+#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
pi@raspberrypi ~ $ sudo apt-get install mplayer
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libaa1 libcdparanoia0 libdca0 libdvdnav4 libdvdread4 libenca0 libfribidi0 liblircclient0 liblzo2-2 libmpeg2-4 libopenal-data libopenal1 libpostproc52 libxvmc1
Suggested packages:
libdvdcss2 lirc libportaudio2 libroar-compat2 mplayer-doc netselect fping
The following NEW packages will be installed:
libaa1 libcdparanoia0 libdca0 libdvdnav4 libdvdread4 libenca0 libfribidi0 liblircclient0 liblzo2-2 libmpeg2-4 libopenal-data libopenal1 libpostproc52 libxvmc1 mplayer
pi@raspberrypi ~ $ sudo apt-get install evtest tslib libts-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libts-0.0-0' instead of 'tslib'
libts-0.0-0 is already the newest version.
libts-0.0-0 set to manually installed.
The following NEW packages will be installed:
evtest libts-bin
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi ~ $ diff -u /etc/modules.20140719 /etc/modules
--- /etc/modules.20140719 2014-07-19 12:38:50.567608153 +0000
+++ /etc/modules 2014-07-19 12:39:07.797409722 +0000
@@ -5,3 +5,5 @@
# Parameters can be specified after the module name.
snd-bcm2835
+spi-bcm2708
+fbtft_device
pi@raspberrypi ~ $ sudo modprobe spi-bcm2708
pi@raspberrypi ~ $ sudo modprobe fbtft_device name=adafruitts rotate=90
pi@raspberrypi ~ $ export FRAMEBUFFER=/dev/fb1
pi@raspberrypi ~ $ startx
X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-2-mx5 armv7l Debian
pi@raspberrypi ~ $ mkdir pitft-setup
pi@raspberrypi ~ $ cd pitft-setup/
pi@raspberrypi ~/pitft-setup $ wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb && \
> wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb && \
> wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb && \
> wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb && \
> wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-112613.deb
--2014-07-21 04:28:16-- http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb
Resolving adafruit-download.s3.amazonaws.com (adafruit-download.s3.amazonaws.com)... 54.231.19.49
Connecting to adafruit-download.s3.amazonaws.com (adafruit-download.s3.amazonaws.com)|54.231.19.49|:80... connected.