예제 #1
0
 def UpdateText(self):
     text = self.GenerateNewsText()
     if self.text != text:
         self.text = text
         msg = Message.WriteText(self.text,
                                 disk_partition=self.partition,
                                 file_label=self.file_label)
         self.led_sign.SendMessage(msg)
         time.sleep(1)
예제 #2
0
forecast_temp_low_2 = str(
    int(celsius2farenheight(float(
        weather['forecasts'][1]['low'])))).encode('UTF-8')
forecast_temp_high_2 = str(
    int(celsius2farenheight(float(
        weather['forecasts'][1]['high'])))).encode('UTF-8')
forecast_text_2 = weather['forecasts'][1]['text'].encode('UTF-8')

text = '{pause=10}{typesetOff}{fastest}{amber}{7x6}{moverightin}{moverightout}Currently: {green}' + condition + '{nl}'
text = '{typesetOff}{fastest}{amber}{7x6}{moverightin}{moverightout}Currently: {green}' + condition.encode(
    'UTF-8') + '{nl}'
text = text + '{amber}{moveleftin}{moveleftout}Temp: {red}' + temp + ' degrees{nl}'
text = text + '{amber}{moverightin}{moverightout}Humidity: {green}' + humidity + '%{nl}'
text = text + '{amber}{moveleftin}{moveleftout}Wind: {red}' + wind + 'mph{nl}'
text = text + '{newframe}{fastest}{amber}{7x6}{moveupin}{movedownout}Forecast:{nl}'
text = text + '{green}' + time_1 + '{nl}'
text = text + '{red}Low:' + forecast_temp_low_1 + ' High: ' + forecast_temp_high_1 + '{nl}'
text = text + '{amber}' + forecast_text_1 + '{nl}'
text = text + '{newframe}{fastest}{amber}{7x6}{movedownin}{moveupout}Forecast:{nl}'
text = text + '{green}' + time_2 + '{nl}'
text = text + '{red}Low:' + forecast_temp_low_2 + ' High: ' + forecast_temp_high_2 + '{nl}'
text = text + '{amber}' + forecast_text_2 + '{nl}'

msg = Message.WriteText(text, file_label='WEATHER.TXT')

port = '/dev/ttyS0'
baudRate = 19200
ser = serial.Serial(port, baudRate)
x = ser.write(msg)
ser.close()
예제 #3
0
 def UpdateText(self):
     msg = Message.WriteText(self.message,
                             disk_partition=self.partition,
                             file_label=self.file_label)
     self.led_sign.SendMessage(msg)
     time.sleep(1)
예제 #4
0
#!/usr/bin/python
# vim: set ts=2 expandtab:

import serial
from JetFileII import Message

msg = Message.WriteText("Hello there. this is a new writefie implementation.")

#print msg.encode("hex")

#print 'size of message is ' + str(len(msg))

port = '/dev/ttyS0'
baudRate = 19200
ser = serial.Serial(port, baudRate)
x = ser.write(msg)
ser.close()