import random
import time
# Threshold value to activate actuator
threshold = 30
while True:
# Simulate reading sensor data
sensor_value = random.randint(0, 10)
# Print sensor value
print("Sensor Value:", sensor_value)
# Conditional logic to activate actuator
if sensor_value > threshold:
print("Actuator ON")
else:
print("Actuator OFF")
# Wait for 2 seconds before next reading
time.sleep(2)
print("----------------------")