Analog Read and Digital Read

Can both analog and digital data values be used in the same in the same if statement in Python Coding?

@tunirkv19 Yes. You can make and store the analog and digital values before the if statement as variables and then use the same in the if code.
Example pseudo-code -
analog_val = myBolt.analogRead(“A0”)
dig_val = myBolt.digitalRead(“1”)
if analog_val > 10:
# do something
print(dig_val)

1 Like

Thanks a lot!
Regards