示例#1
0
def initLCD():
    lcd = CharLCD(pin_rs=26,
                  pin_e=19,
                  pins_data=[13, 6, 5, 11],
                  numbering_mode=GPIO.BCM,
                  cols=16,
                  rows=2)
    lcd.cursor_mode = 'hide'
示例#2
0
delay = 3
run = True

# Create an object of the class MFRC522
MIFAREReader = MFRC522.MFRC522()

lcd = CharLCD(pin_rs=32,
              pin_e=33,
              pins_data=[36, 35, 38, 40],
              numbering_mode=GPIO.BOARD,
              cols=20,
              rows=4,
              dotsize=8,
              charmap='A02',
              auto_linebreaks=True)
lcd.cursor_mode = CursorMode.hide

lcd.write_string('Please Scan Card...')


def signal_handler(signal, frame):
    global continue_reading
    print "Cleaning up GPIO pins"
    continue_reading = False
    GPIO.cleanup()


signal.signal(signal.SIGINT, signal_handler)


def read_temp_raw():
示例#3
0
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import time, sys, RPi.GPIO as GPIO
from RPLCD.gpio import CharLCD
from keypad import keypad

GPIO.setwarnings(False)

lcd = CharLCD(pin_rs=26,
              pin_e=19,
              pins_data=[13, 6, 5, 11],
              numbering_mode=GPIO.BCM,
              cols=16,
              rows=2)
lcd.cursor_mode = 'hide'

kp = keypad(columnCount=4)

heatingPin = 17

GPIO.setmode(GPIO.BCM)
GPIO.setup(heatingPin, GPIO.OUT)

sensor = '/sys/bus/w1/devices/28-011453efb2aa/w1_slave'
targetTemp = float(26.0)
integralFactor = float(0.8)
cycleTime = float(10)
skip = False


def initLCD():
示例#4
0
from RPLCD.gpio import CharLCD
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
lcd = CharLCD(cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23],numbering_mode=GPIO.BOARD)
lcd.write_string(u'Hello world!')
lcd.cursor_mode = 'blink'
示例#5
0
    pass

try:
    unichr = unichr
except NameError:
    unichr = chr

lcd = CharLCD(cols=16, rows=2)
# if you have a backlight circuit, initialize like this (substituting the
# appropriate GPIO and BacklightMode for your backlight circuit):
#lcd = CharLCD(cols=16, rows=2, pin_backlight=7, backlight_mode=BacklightMode.active_high)

lcd.backlight = True
input('Display should be blank. ')

lcd.cursor_mode = CursorMode.blink
input('The cursor should now blink. ')

lcd.cursor_mode = CursorMode.line
input('The cursor should now be a line. ')

lcd.write_string('Hello world!')
input('"Hello world!" should be on the LCD. ')

assert lcd.cursor_pos == (0, 12), 'cursor_pos should now be (0, 12)'

lcd.cursor_pos = (0, 15)
lcd.write_string('1')
lcd.cursor_pos = (1, 15)
lcd.write_string('2')
assert lcd.cursor_pos == (0, 0), 'cursor_pos should now be (0, 0)'
from time import sleep
from subprocess import call
GPIO.setmode(GPIO.BCM)  # setup pinmode
GPIO.setwarnings(False)

from RPLCD.gpio import CharLCD
from time import sleep
import RPi.GPIO as GPIO
lcd = CharLCD(cols=16,
              rows=2,
              pin_rs=26,
              pin_e=19,
              pins_data=[13, 6, 5, 11],
              numbering_mode=GPIO.BCM)
lcd.clear()
lcd.cursor_mode = "hide"
lcd.write_string('SockMatcher 5000')
lcd.cursor_pos = (1, 0)
lcd.write_string('Please wait')

BUTTPIN = 23
SHUTDOWNBUTTPIN = 4
HOMEPIN = 15

# Motor direction
CW = 0
CCW = 1

motorBelt = 1
motorTurntable = 2
GPIO.setup(BUTTPIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)