IndentationError: expected an indented block ERROR?

Home / Uncategorized / IndentationError: expected an indented block ERROR?

Question:
I searched all about "IndentationError: expected an indented block" but i can not find answer for my problem.

I want to use Rfid Rc-522 with DC motor on my raspberry pi 3. But i can not.

My error is ;
kart_uid = str(uid[0])+" "+str(uid[1])+" "+str(uid[2])+" "+str(uid[3])+" "+str(uid[4])
^
IndentationError: expected an indented block
My code is ;
from pirc522 import RFID
from time import sleep
import signal
import time
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BOARD)
GPIO.setup(Motor1A,GPIO.OUT)
GPIO.setup(Motor1B,GPIO.OUT)
GPIO.setup(Motor1E,GPIO.OUT)

Motor1A = 16
Motor1B = 18
Motor1E = 22

rdr = RFID()
util = rdr.util()
util.debug = True

while True:rdr.wait_for_tag()
(error, data) = rdr.request()
if not error:print("nKart Algilandi!")
(error, uid) = rdr.anticoll()
if not error:# Print UID
kart_uid = str(uid[0])+" "+str(uid[1])+" "+str(uid[2])+" "+str(uid[3])+" "+str(uid[4])
print(kart_uid)
if kart_uid == "224 46 255 27 42":print("The engine is turning right")
GPIO.output(Motor1A,GPIO.HIGH)
GPIO.output(Motor1B,GPIO.LOW)
GPIO.output(Motor1E,GPIO.HIGH)
sleep(8)

else:print("The engine is turning left!")
GPIO.output(Motor1A,GPIO.LOW)
GPIO.output(Motor1B,GPIO.HIGH)
PIO.output(Motor1E,GPIO.HIGH)
sleep(8)
print "Engine Stopped!"
GPIO.output(Motor1E, False)
GPIO.cleanup()
Thanks in advance..


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *