I am trying to compare an ASCII character that I am receiving from the serial port with a string. I am not able to do that, even though it seems like I have converted the inputs successfully. Here is my code
import serial
import time
port="/dev/ttyUSB0"
serialArduino= serial.Serial(port,9600)
serialArduino.flushInput()
inputs=""
while True:
inputsp=serialArduion.readline()
for letter in inputsp:
inputs=inputs+ str(letter)
print inputs
if inputs=="DOWN":
print "APPLES"
elif inputs=="UP"
print "Bannana"
ok so even though the input sometimes equals UP OR DOWN it still does not print out APPLES or Bannana