guowenxue
2019-03-25 c49cbe713f62ded429337d5c830f4c23a1b5d9e3
Merge branch 'master' of ssh://master.iot-yun.com:2280/raspberrypi
4 files modified
26 ■■■■■ changed files
modules/python/ds18b20.py patch | view | raw | blame | history
modules/python/infrared.py 8 ●●●● patch | view | raw | blame | history
modules/python/sht20.py 2 ●●●●● patch | view | raw | blame | history
monitord/monitord.py 16 ●●●●● patch | view | raw | blame | history
modules/python/ds18b20.py
old mode 100644 new mode 100755
modules/python/infrared.py
old mode 100644 new mode 100755
@@ -1,8 +1,12 @@
#!/usr/bin/python
#-*- coding: utf-8 -*-
import time
import signal
import RPi.GPIO as GPIO
INFR_PIN=16
# I/O Pin connected to Physical PIN#16, BCM code pin number is 20 and wPi pin number is 28
INFR_PIN=20
def sig_proc(signum, frame):
    print("Catch stop signal and program exit now...")
@@ -13,7 +17,7 @@
 
def init():
    GPIO.setwarnings(False)
    GPIO.setmode(GPIO.BOARD)
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(INFR_PIN, GPIO.IN)
    pass
 
modules/python/sht20.py
old mode 100644 new mode 100755
@@ -1,4 +1,6 @@
#!/usr/bin/python
#-*- coding: utf-8 -*-
import fcntl
import time
import unittest
monitord/monitord.py
@@ -10,17 +10,19 @@
from pygame.locals import *
from ftplib import FTP
RELAY_OFF_TIMEOUT=15
ON=1
OFF=0
# I/O Pin connected to PIN#16, BCM code pin number is 23 and wPi pin number is 4
infrared_pin=16
# I/O Pin connected to Physical PIN#16, BCM code pin number is 20 and wPi pin number is 28
infrared_pin=20
# I/O Pin connected to PIN#12, which can set be PWM mode
# I/O Pin Not Connected
buzzer_pin=12
# I/O Pin connected to PIN#18, BCM code pin number is 24 and wPi pin number is 5
relay_pin=18
# I/O Pin connected to Physical PIN#40, BCM code pin number is 21 and wPi pin number is 29
relay_pin=21
capture_times=2
local_image="rpi_capture.jpg"
@@ -50,7 +52,7 @@
  #Raspberry Python GPIO Initialise
  GPIO.setwarnings(False)
  GPIO.setmode(GPIO.BOARD)
  GPIO.setmode(GPIO.BCM)
  # Initialise infrared GPIO port
  GPIO.setup(infrared_pin, GPIO.IN)
@@ -93,7 +95,7 @@
  #turn_buzzer_on()
  turn_relay(ON)
  signal.alarm(30)
  signal.alarm(RELAY_OFF_TIMEOUT)
  camera = pygame.camera.Camera("/dev/video0",(1024,768))
  camera.start()