예제 #1
0
from adafruit.Adafruit_LEDBackpack.Adafruit_8x8 import EightByEight
import time

PATTERN_N = [0x81, 0x83, 0x85, 0x89, 0x91, 0xA1, 0xC1, 0x81]
PATTERN_A = [0x81, 0x81, 0x81, 0x81, 0xFF, 0x42, 0x24, 0x18]


def writePattern(pattern):
    for row in range(8):
        grid.writeRowRaw(row, pattern[row])

grid = EightByEight(address=0x70)
grid.clear()

while True:
    writePattern( PATTERN_A )
    time.sleep(0.5)
    writePattern( PATTERN_N )
    time.sleep(0.5)
예제 #2
0
#!/usr/bin/python
# -*- coding: utf8 -*-

from adafruit.Adafruit_ADS1x15.Adafruit_ADS1x15 import ADS1x15
import time, math, sqlite3, os, signal, sys, gps2 as gps
import datetime
from adafruit.Adafruit_LEDBackpack.Adafruit_8x8 import EightByEight
from adafruit.Adafruit_LEDBackpack import Adafruit_LEDBackpack

# ===========================================================================
# 8x8 Pixel Example
# ===========================================================================
grid = EightByEight(address=0x70)
led = Adafruit_LEDBackpack.LEDBackpack(0x70)
led.setBrightness = 1
hasGrid = True
displayChannels = 2


def signal_handler(signal, frame):
    print 'You pressed Ctrl+C!'
    sys.exit(0)


signal.signal(signal.SIGINT, signal_handler)
#print 'Press Ctrl+C to exit'

display = 0

# ============================================================================
# Example Code
예제 #3
0
파일: testadc.py 프로젝트: jloosli/incite
logger.info("Logger started")

from adafruit.Adafruit_ADS1x15.Adafruit_ADS1x15 import ADS1x15
from gpsPoller import GpsPoller
import time, math, sqlite3, os, signal, sys, logging
import datetime

from adafruit.Adafruit_LEDBackpack.Adafruit_8x8 import EightByEight
from adafruit.Adafruit_LEDBackpack import Adafruit_LEDBackpack


# ===========================================================================
# 8x8 Pixel Example
# ===========================================================================
grid = EightByEight(address=0x70)
led = Adafruit_LEDBackpack.LEDBackpack(0x70)
led.setBrightness = 1
hasGrid = True
displayChannels = 2



def signal_handler(signal, frame):
        print 'You pressed Ctrl+C!'
        sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
#print 'Press Ctrl+C to exit'

display = 0
예제 #4
0
#!/usr/bin/python
# -*- coding: utf8 -*-

from adafruit.Adafruit_ADS1x15.Adafruit_ADS1x15 import ADS1x15
import time, math, sqlite3, os, signal, sys, gps2 as gps
import datetime
from adafruit.Adafruit_LEDBackpack.Adafruit_8x8 import EightByEight
from adafruit.Adafruit_LEDBackpack import Adafruit_LEDBackpack

# ===========================================================================
# 8x8 Pixel Example
# ===========================================================================
grid = EightByEight(address=0x70)
led = Adafruit_LEDBackpack.LEDBackpack(0x70)
led.setBrightness = 1
hasGrid = True
displayChannels = 2


def signal_handler(signal, frame):
        print 'You pressed Ctrl+C!'
        sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
#print 'Press Ctrl+C to exit'

display = 0

# ============================================================================
# Example Code
# ============================================================================
ADS1015 = 0x00  # 12-bit ADC