Error regarding temperature sensor using LMR35

I am not able to run python code,it’s showing error as invalid syntax
for the line( if sensor_value > maximum_limit or sensor_value <minimum_limit:)

Hey @raoswathi.2613,

Could you share the screenshot of the whole code or the error specifically? Try changing the values of the variable maximum_limit and minimum_limit. Make sure they logically make sense.

1 Like

@raoswathi.2613 You have misplaced the colon. It should be,
if (sensor_value > maximum_limit or sensor_value <minimum_limit):

1 Like

still not able to solve the error

can you share the code

@raoswathi.2613 Please share the code and the error that you are getting.

Dont use brackets i,e, (the one at the beginning and end). Make proper spacing.
Try like below;
if sensor_value > maximum_limit or sensor_value < minimum_limit:

if it still doesn’t work, check your limits
minimum_limit = 000
maximum_limit = 111
the values can be anything within the range. check spelling and spacing.

Also check if the spacing of red enclosed region in the attached screenshot is proper.

if you provide your screenshot of code and error it will be easier to solve your problem.

1 Like