def updateArrow(): for i in range (10000): windSpeed = bcWeather.getWindSpeed() windDirection = bcWeather.getWindDirection() print "Wind Speed:",float(windSpeed) print "Wind Direction:",float(windDirection) world.clear() weatherArrow(windSpeed, windDirection) time.sleep(1)
def arrow(): #function to draw arrow windSpeed = bcWeather.getWindSpeed() #get wind speed & direction windDirection = bcWeather.getWindDirection() print "Wind Speed:",float(windSpeed) #print wind speed & direction print "Wind Direction:",float(windDirection) lt(turt,90.0-windDirection) #orient turtle and draw arrow fd(turt,20.0+20.0*windSpeed) lt(turt,135) fd(turt,30) lt(turt,180) fd(turt,30) rt(turt,90) fd(turt,30) rt(turt,180) fd(turt,30) lt(turt, 135) fd(turt,20.0+20.0*windSpeed) lt(turt,90.0+windDirection)