This file contains hidden or 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 os | |
import pygame | |
import time | |
import signal | |
#some const | |
BLACK = (0, 0, 0) | |
RED = (200, 0, 0) | |
WHITE = (255,255,255) |
This file contains hidden or 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/python3 | |
# -*- coding: utf-8 -*- | |
from tkinter import * | |
from pyModbusTCP.client import ModbusClient | |
import time | |
# some const | |
SERVER_HOST = "192.168.0.64" | |
SERVER_PORT = 502 |
This file contains hidden or 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 | |
import time | |
import schedule | |
import RPi_I2C_LCD | |
# global var | |
lcd = RPi_I2C_LCD.LCD() | |
def update_lcd(): |
This file contains hidden or 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
[program:sigfox] | |
command=sigfox_xxxxx.py | |
user=pi | |
directory=/home/pi/ | |
autostart=true | |
autorestart=false | |
environment=PYTHONUNBUFFERED=1 |
This file contains hidden or 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 | |
import os, time | |
while True: | |
with open('/sys/class/thermal/thermal_zone0/temp', 'r') as f: | |
cpu_temp = round(float(f.read()) / 1000) | |
os.system('espeak -v mb-fr1 -s 95 \'La température de la CPU est de %s degrés.\'' % cpu_temp) | |
time.sleep(2.0) |
This file contains hidden or 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 cv2 | |
import numpy as np | |
# open_cv track test : | |
# | |
# track blue object and check there are in circle area | |
# for test: object is a blue water bottle cap (color H,S,V = 202 (101 after normalized, 64, 59) | |
# some class |
This file contains hidden or 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 python | |
# shoot jpg images at regular interval for timelapse (store to img/) | |
# | |
# build MPEG4 video with jpg files : | |
# ffmpeg -framerate 10 -i img/image%04d.jpg -c:v libx264 -r 10 video/timelapse.mp4 | |
#or | |
# ffmpeg -framerate 2 -i img/image%04d.jpg video/timelapse2.mp4 | |
import time |
This file contains hidden or 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
#!/bin/bash | |
# create a new sources list for use APT with this USB source mirror | |
USB_LIST=/etc/apt/sources.list.d/usb_source.list | |
# check root level | |
if [ $EUID -ne 0 ] | |
then | |
echo "This script must be run as root" 1>&2 | |
exit 1 |
This file contains hidden or 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 -*- | |
# retrieve modbus data from CP4900 device and store it to a redis DB | |
from pyHMI.DS_ModbusTCP import ModbusTCPDevice | |
from pyHMI.Tag import Tag | |
import redis | |
import time |
This file contains hidden or 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
<!DOCTYPE html> | |
<?php | |
require 'Predis/Autoloader.php'; | |
Predis\Autoloader::register(); | |
$r = new Predis\Client(); | |
?> | |
<html> | |
<head> | |
<title>Test REDIS</title> | |
</head> |