在我的项目“智能停车场”中,我使用了arduino uno,10个红外接近传感器,LCD 16.02 i2c和微型伺服电机,因此我认为代码有问题。
当汽车驶近时,进入传感器应该提起附着在伺服系统上的障碍物,然后直到它通过杆后才关闭。横杆和出口传感器之后将有另一个红外传感器以相同的方式工作。 LCD必须打印出可用的位置数,直到其满为止,以便打印“满”。
def playgame(tries):# Takes tries
chosenword_ = list(chosenword)
while tries != 0 and chosenword_: #While tries is not 0
guess = str(input("Guess a letter of the word: ")).lower() #Ask for a guess
guess_letters.append(guess) #add guess to guess_letters list
if guess in chosenword: #if your guess in chosenword
print("You got a letter correct!")
tries -= 1
try:
chosenword_.remove(guess)
except ValueError:
pass
elif guess not in chosenword:
print("That letter is not in the word")
tries -= 1
dashshow(guess_letters) # last call the dashshow function