import streamlit as st st.set_page_config(page_title="AI Robot Simulator", layout="centered") st.title("π€ AI Obstacle Avoiding Robot Simulator") st.write("Simulation of Arduino AI logic using Ultrasonic Sensor distance.") # Distance Input Slider distance = st.slider("Set Distance from Obstacle (cm)", 0, 100, 50) st.subheader("π‘ Sensor Reading") st.write(f"Distance Detected: **{distance} cm**") # AI Decision Logic st.subheader("π§ AI Decision Output") if distance > 25: st.success("AI Action: Moving Forward π") elif 10 < distance <= 25: st.warning("AI Action: Slowing Down β οΈ") else: st.error("AI Action: Stop + Turn Right π") # Explanation st.markdown("---") st.subheader("π Arduino AI Rule System") st.code(""" if distance > 25: Move Forward elif distance between 10 and 25: Slow Down else: Stop and Turn """)
verified
VIATEUR-AI commited on