Exemplo n.º 1
0
def Main():
    gameIntro = GameIntro()
    gameIntro.getIntro()
    player = Player()
    player.namePlayer()
    weather = Weather()
    weather.getWeather()
    print ("Today's weather forecast is %s." % (weather.weather))
    temperature = Temperature()
    temperature.getTemperature()
    print("Today's temperature will %s degrees." % (temperature.temperature))
    print("Let's get our supplies and make some lemonade.")
    price = Pricing()
    price.setprice()
    playerChoice.setPrice()
Exemplo n.º 2
0
def ProcessData():
    light = photoresistorValue()
    temp = Temperature()

    data = devTempLight(temp.getTemperature(), light.get_Voltage(),
                        datetime.datetime.now())
    jsonData = jsonpickle.encode(data, unpicklable=False)
    print(jsonData)
Exemplo n.º 3
0
            step = step + 1

            print "received [%s]" % data

            # -------------------------------------READING STREAMED DATA FROM THE USER ---------------------------------------------

            if data == 'FORWARD':  # FORWARD String was received from user
                forward()
            elif data == 'BACKWARD':  # BACKWARD String was received from user
                backward()
            elif data == 'LEFT':  # LEFT String was received from user
                left()
            elif data == 'RIGHT':  # RIGHT String was received from user
                right()
            elif data == 'TEMP':  # TEMP String was received from user
                temp = t.getTemperature()
                sleep(1)
                # data = str(temp) + "*C"
                print data + " " + str(temp)
                client_sock.send(bytes(temp))
            elif data == 'BUZZER ON':  # BUZZER ON String was received from user
                b.buzzOn()
            elif data == 'BUZZER OFF':  # BUZZER OFF String was received from user
                b.buzzOff()
            elif data == 'Red':  # Red String was received from user
                rgb.redColour()
            elif data == 'Green':  # Green String was received from user
                rgb.greenColour()
            elif data == 'Blue':  # Blue String was received from user
                rgb.blueColour()
            elif data == 'No Colour':  # No Colour String was received from user