Пример #1
0
def x_front_y_back(x,y):
	if(x>y):
		GPIO.output(27,GPIO.HIGH)
		GPIO.output(23,GPIO.HIGH)
		print("wait sec",y)
		time.sleep(y)
		GPIO.output(23,GPIO.LOW)
		x=x-y
		print("wait sec",x)
		time.sleep(x)
		GPIO.output(27,GPIO.LOW)
	elif(x<y):
		GPIO.output(27,GPIO.HIGH)
		GPIO.output(23,GPIO.HIGH)
		print("wait sec",x)
		time.sleep(x)
		GPIO.output(27,GPIO.LOW)
		y=y-x
		print("wait sec",y)
		time.sleep(y)
		GPIO.output(23,GPIO.LOW)
	elif(x==y):
		GPIO.output(27,GPIO.HIGH)
		GPIO.output(23,GPIO.HIGH)
		print("wait sec",x)
		time.sleep(y)
		GPIO.output(27,GPIO.LOW)
		GPIO.output(23,GPIO.LOW)
	lcd_i2c.main(string1="Weed removed",string2 = "")
Пример #2
0
#!/usr/bin/python
import os, sys
import weedpotato as pre
import cv2
import numpy as np
import lcd_i2c
from PIL import Image

# Open a file
lcd_i2c.main(string1="Image Captured",string2 = "")
path = "/home/pi/project/potatodatasets/"
dirs = os.listdir( path )
# This would print all the files and directories
for imagename in dirs:	
	print("image processing")
	print(imagename)
	pre.main(path,imagename)
lcd_i2c.main(string1="Preprocessing",string2 = "Image")
# Open a file
path = "/home/pi/project/output-images/"
dirs = os.listdir( path )
count =1
dic1={}

# This would print all the files and directories
lcd_i2c.main(string1="Finding ",string2 = "Weed Coordinates")
for imagename in dirs:
	img = Image.open("/home/pi/project/potatodatasets/image1.jpg")	
	print("image number processing")
	print(count)
	print(imagename)
Пример #3
0
streamstate = []
channelstate = []
followers = []
raffle = False
raffleusr = []
roulette = False
followhorstream = []

print("Collecting API's infos for " + CHANNEL.split('#')[1] + "'s channel")
CHANNELID = getuser(username=CHANNEL.split("#")[1])
INFOSCHAT()
CHANNELSTATE()
print("Done")

try:
    lcd_i2c.main()
except Exception:
    pass

connection()

print("Starting bot's functionnalities...")
threading.Thread(target=streaminfo).start()
threading.Thread(target=recurrence).start()
threading.Thread(target=newchat).start()
threading.Thread(target=StreamThread).start()
threading.Thread(target=newfollow).start()
time.sleep(5)
pause = False
print("Bot fully started, here's the chat :\r\n")