Пример #1
0
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>

import os
import sys
import serial

sys.path.append('lib')
import serialThread
from dials import *

PORT = serial.Serial('/dev/pts/4', 9600, timeout=None)
incomingData = serialThread.ReadStream(PORT, True)

os.environ['SDL_VIDEO_WINDOW_POS'] = 'center'

size = width, height = 1320, 740

pygame.display.set_caption('K11Consult: %s' % __file__)

monitorX = pygame.display.Info().current_w
monitorY = pygame.display.Info().current_h

surface1FullscreenX = (monitorX / 2) - 650
surface1FullscreenY = (monitorY / 2) - 360

surface1WindowedX = (width / 2) - 650
surface1WindowedY = (height / 2) - 360
Пример #2
0
#!/usr/bin/python

import sys
import serial

sys.path.append('../lib')
import serialThread

PORT = serial.Serial('/home/ben/k11consult/K11Consult/SCRIPT',
                     9600,
                     timeout=None)

bla = serialThread.ReadStream(PORT)
#try:
while True:
    #PORT.flushInput()
    #PORT.write('\xFF\xFF\xEF')
    #serialThread.time.sleep(2)
    #Connected = PORT.read(1)
    #if Connected == '\x10':
    #print 'connected'
    #READ_THREAD = True
    #serialThread.ReadStream(PORT).convertToMPH
    print bla.returnMPH()
    #serialThread.time.sleep(0.002)

#except ValueError:

#PORT.open()