Episode Video
This episode covers solar array tracking with hash-based batch writes and performance-safe loops.
Watch Episode 3 on YouTube
IC10 Learning Series
Episode 3 builds a practical solar tracker using a sensor feed, offset correction, and batch writes to multiple panel families from one loop.
This episode covers solar array tracking with hash-based batch writes and performance-safe loops.
Watch Episode 3 on YouTube
sb in one pass.yield so the script runs once per second.# Define Devices - d0 -> d5 alias sensor d0 # Define Variables - r0 -> r15 alias vertical r0 alias horizontal r1 define solarPanelHash -2045627372 define solarPanelDualHash -539224550 define solarPanelHeavyHash -934345724 define solarPanelHeavyDualHash -1545574413 # Main Loop Start: yield # Makes script run only once per second - Performance # Read Vertical from sensor l vertical sensor Vertical # Read Horizontal from sensor l horizontal sensor Horizontal # Apply Offset to Vertical and Horizontal add vertical vertical 90 add horizontal horizontal 90 # Batch Write to all Solar Panels sb solarPanelHash Vertical vertical sb solarPanelHash Horizontal horizontal sb solarPanelDualHash Vertical vertical sb solarPanelDualHash Horizontal horizontal sb solarPanelHeavyHash Vertical vertical sb solarPanelHeavyHash Horizontal horizontal sb solarPanelHeavyDualHash Vertical vertical sb solarPanelHeavyDualHash Horizontal horizontal j Start
yield
Pauses execution until the next tick, reducing script load and making updates run about once per second.
l vertical sensor Vertical / l horizontal sensor Horizontal
Reads the current tracking angles from the sensor into registers for processing.
add vertical vertical 90 / add horizontal horizontal 90
Applies a +90 offset so panel orientation aligns with your physical build orientation.
sb solarPanelHash Vertical vertical
Uses batch write to set a property across every device matching that prefab hash in one command.
j Start
Loops back and continuously retargets panels as solar angles move.