#!/usr/bin/python
import sys
import time
from sense_hat import SenseHat
from evdev import InputDevice, list_devices, ecodes

print("Press Ctrl-C to quit")
time.sleep(1)

sense = SenseHat()
sense.clear()  # Blank the LED matrix

found = False;
devices = [InputDevice(fn) for fn in list_devices()]
for dev in devices:
    if dev.name == 'Raspberry Pi Sense HAT Joystick':
        found = True;
        break

if not(found):
    print('Raspberry Pi Sense HAT Joystick not found. Aborting ...')
    sys.exit()

# 0, 0 = Top left
# 7, 7 = Bottom right
PIXELS = [[0,0],[0,1],[0,2],[1,0],[1,2],[1,1]]# [7,7]]

def set_pixels(pixels, col):
    for p in pixels:
        sense.set_pixel(p[0], p[1], col[0], col[1], col[2])


BLUE = [0, 0, 255]
GREEN = [30, 179, 90]

try:
    fread = open('parkingSpotStatus.csv','w')
    fread.write('FREE')
    sense.show_message('',back_colour = GREEN, text_colour=[255,0,0])
 
except KeyboardInterrupt:
    sys.exit()

42e943b37096edd0ccb182d2891c88a2feebb78e
<mask token>


def set_pixels(pixels, col):
    for p in pixels:
        sense.set_pixel(p[0], p[1], col[0], col[1], col[2])


<mask token>

<mask token>
print('Press Ctrl-C to quit')
time.sleep(1)
<mask token>
sense.clear()
<mask token>
for dev in devices:
    if dev.name == 'Raspberry Pi Sense HAT Joystick':
        found = True
        break
if not found:
    print('Raspberry Pi Sense HAT Joystick not found. Aborting ...')
    sys.exit()
<mask token>


def set_pixels(pixels, col):
    for p in pixels:
        sense.set_pixel(p[0], p[1], col[0], col[1], col[2])


<mask token>
try:
    fread = open('parkingSpotStatus.csv', 'w')
    fread.write('FREE')
    sense.show_message('', back_colour=GREEN, text_colour=[255, 0, 0])
except KeyboardInterrupt:
    sys.exit()

<mask token>
print('Press Ctrl-C to quit')
time.sleep(1)
sense = SenseHat()
sense.clear()
found = False
devices = [InputDevice(fn) for fn in list_devices()]
for dev in devices:
    if dev.name == 'Raspberry Pi Sense HAT Joystick':
        found = True
        break
if not found:
    print('Raspberry Pi Sense HAT Joystick not found. Aborting ...')
    sys.exit()
PIXELS = [[0, 0], [0, 1], [0, 2], [1, 0], [1, 2], [1, 1]]


def set_pixels(pixels, col):
    for p in pixels:
        sense.set_pixel(p[0], p[1], col[0], col[1], col[2])


BLUE = [0, 0, 255]
GREEN = [30, 179, 90]
try:
    fread = open('parkingSpotStatus.csv', 'w')
    fread.write('FREE')
    sense.show_message('', back_colour=GREEN, text_colour=[255, 0, 0])
except KeyboardInterrupt:
    sys.exit()

import sys
import time
from sense_hat import SenseHat
from evdev import InputDevice, list_devices, ecodes
print('Press Ctrl-C to quit')
time.sleep(1)
sense = SenseHat()
sense.clear()
found = False
devices = [InputDevice(fn) for fn in list_devices()]
for dev in devices:
    if dev.name == 'Raspberry Pi Sense HAT Joystick':
        found = True
        break
if not found:
    print('Raspberry Pi Sense HAT Joystick not found. Aborting ...')
    sys.exit()
PIXELS = [[0, 0], [0, 1], [0, 2], [1, 0], [1, 2], [1, 1]]


def set_pixels(pixels, col):
    for p in pixels:
        sense.set_pixel(p[0], p[1], col[0], col[1], col[2])


BLUE = [0, 0, 255]
GREEN = [30, 179, 90]
try:
    fread = open('parkingSpotStatus.csv', 'w')
    fread.write('FREE')
    sense.show_message('', back_colour=GREEN, text_colour=[255, 0, 0])
except KeyboardInterrupt:
    sys.exit()

#!/usr/bin/python
import sys
import time
from sense_hat import SenseHat
from evdev import InputDevice, list_devices, ecodes

print("Press Ctrl-C to quit")
time.sleep(1)

sense = SenseHat()
sense.clear()  # Blank the LED matrix

found = False;
devices = [InputDevice(fn) for fn in list_devices()]
for dev in devices:
    if dev.name == 'Raspberry Pi Sense HAT Joystick':
        found = True;
        break

if not(found):
    print('Raspberry Pi Sense HAT Joystick not found. Aborting ...')
    sys.exit()

# 0, 0 = Top left
# 7, 7 = Bottom right
PIXELS = [[0,0],[0,1],[0,2],[1,0],[1,2],[1,1]]# [7,7]]

def set_pixels(pixels, col):
    for p in pixels:
        sense.set_pixel(p[0], p[1], col[0], col[1], col[2])


BLUE = [0, 0, 255]
GREEN = [30, 179, 90]

try:
    fread = open('parkingSpotStatus.csv','w')
    fread.write('FREE')
    sense.show_message('',back_colour = GREEN, text_colour=[255,0,0])
 
except KeyboardInterrupt:
    sys.exit()
