コード例 #1
0
ファイル: PiStorms.py プロジェクト: tizcodex/PiStorms
    def __init__(self, name="PiStorms", rotation=3):

        ## An instance of mindsensorsUI.mindsensorsUI representing the PiStorms's touchscreen.
        self.screen = mindsensorsUI(name, rotation)
        ## An instance of PiStormsCom.PiStormsCom.
        self.psc = PiStormsCom()
        ## An instance of PiStormsSensor representing Bank A sensor 1.
        self.BAS1 = PiStormsSensor(self.psc.BAS1)
        ## An instance of PiStormsSensor representing Bank A sensor 2.
        self.BAS2 = PiStormsSensor(self.psc.BAS2)
        ## An instance of PiStormsSensor representing Bank B sensor 1.
        self.BBS1 = PiStormsSensor(self.psc.BBS1)
        ## An instance of PiStormsSensor representing Bank B sensor 2.
        self.BBS2 = PiStormsSensor(self.psc.BBS2)

        ## An instance of PiStormsMotor representing Bank A motor 1.
        self.BAM1 = PiStormsMotor(self.psc.BAM1)
        ## An instance of PiStormsMotor representing Bank A motor 2.
        self.BAM2 = PiStormsMotor(self.psc.BAM2)
        ## An instance of PiStormsMotor representing Bank B motor 1.
        self.BBM1 = PiStormsMotor(self.psc.BBM1)
        ## An instance of PiStormsMotor representing Bank B motor 2.
        self.BBM2 = PiStormsMotor(self.psc.BBM2)

        self.psc.resetKeyPressCount()
コード例 #2
0
ファイル: PiStorms.py プロジェクト: modulusx/PiStorms
    def __init__(self, name="PiStorms", rotation=3):

        self.screen = mindsensorsUI(name, rotation)
        self.psc = PiStormsCom()
        self.BAS1 = PiStormsSensor(self.psc.BAS1)
        self.BAS2 = PiStormsSensor(self.psc.BAS2)
        self.BBS1 = PiStormsSensor(self.psc.BBS1)
        self.BBS2 = PiStormsSensor(self.psc.BBS2)

        self.BAM1 = PiStormsMotor(self.psc.BAM1)
        self.BAM2 = PiStormsMotor(self.psc.BAM2)
        self.BBM1 = PiStormsMotor(self.psc.BBM1)
        self.BBM2 = PiStormsMotor(self.psc.BBM2)
コード例 #3
0
ファイル: mindsensorsUI.py プロジェクト: tizcodex/PiStorms
    def __init__(self, name="PiStorms", rotation=3):
        config = ConfigParser.RawConfigParser()
        config.read("/usr/local/mindsensors/conf/msdev.cfg")
        if "GRX" in config.get('msdev', 'device'):
            self.comm = GRXCom
        else:
            self.comm = PiStormsCom()
        # note self.comm is only used to getTouchscreenCoordinates and to getKeyPressCount
        self.disp.begin()
        self.clearScreen()
        self.disp.command(ILI9341_INVOFF)

        if (rotation in range(4)):
            self.currentRotation = rotation
        self.refresh()
        self.myname = name
コード例 #4
0
ファイル: get-device-type.py プロジェクト: tizcodex/PiStorms
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#mindsensors.com invests time and resources providing this open source code,
#please support mindsensors.com  by purchasing products from mindsensors.com!
#Learn more product option visit us @  http://www.mindsensors.com/
#
# History:
# Date      Author      Comments
# 05/02/16  deepak      Initial development
#
# we could also do this instead:
# i2cdump -y -r 0x00-0x04 1 0x1a | grep "^00:" | cut -c 56-60
#

from PiStormsCom import PiStormsCom
comm = PiStormsCom()

import ConfigParser
config = ConfigParser.RawConfigParser()
config.read("/usr/local/mindsensors/conf/msdev.cfg")

if "GRX" in comm.GetDeviceFeatures().upper():
    config.set('msdev', 'device', 'PiStorms-GRX')
else:
    config.set('msdev', 'device', 'PiStorms')

with open("/usr/local/mindsensors/conf/msdev.cfg", 'wb') as configfile:
    config.write(configfile)
コード例 #5
0
ファイル: psm_shutdown.py プロジェクト: tizcodex/PiStorms
#
# Copyright (c) 2016 mindsensors.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# 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, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#mindsensors.com invests time and resources providing this open source code,
#please support mindsensors.com  by purchasing products from mindsensors.com!
#Learn more product option visit us @  http://www.mindsensors.com/
#
# History:
# Date      Author      Comments
# 05/25/16   Deepak     Initial development.
#

from PiStormsCom import PiStormsCom

psc = PiStormsCom()

psc.Shutdown()