Can anyone tell me why my Pi can not access the deeper commands?

It always stops at the command print("cho tao"). I checked whether the conditional statement if state2== True) : worked. My GPIO.input(19) it also changes its value from 0 to 1. It should also work if my state2 get the value of "1" but it does not.

Screenshot of code

  • 2
    Please don't post code as images. Cut & paste the text into your question. – joan May 5 '19 at 11:11
  • @RalfFriedl - Please try to make your edits more complete, as there were a number of other issues with the post. – Greenonline May 5 '19 at 13:12
  • do not use statements like if (state2 == True): ... that is same as if (True == True): ..... the statement should be if (True):, so use if (state2): – jsotola May 6 '19 at 1:30

The error is saying that

if (state2 = True)

is a syntax error.

The line in the code appears to be

if (state2 == True):

which appears correct.

I think you may have an unprintable character on that line.

I suggest you delete the line and type it in again.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.