Graph Programming

Graph Programming allows your robot to perform actions based on the data recorded during an experiment.


Graph Programming tab
Select Sensor
Show/Hide Threshold Zones
Threshold Zone Icons
Zone Programming Panel

The key to using graph programming is setting up Threshold Zones. The Zone Programming Panel is used to create a set of Programming Blocks that will run when the sensor value is within that particular Zone. Each zone is separated from the next zone by a Threshold Value. Adjust the threshold by dragging the Threshold Line up or down, or by typing a specific number in the Threshold Value.
Example 1: Doorway Greeter
Your robot measures the distance across a doorway. When a person walks through, the Ultrasonic Sensor measures a lower distance, and the robot plays the “Morning” sound file.

Select the Star Zone and the Square Zone to create two zones. Adjust the Zone Threshold to detect when someone walks through the doorway. In this case, we have chosen 30 cm. When the sensor value is in the Star Zone (that is above 30 cm), the robot will run the Programming Blocks associated with the Star Zone. When the sensor value is in the Square Zone (that is, below 30 cm), the robot will run the Programming Blocks associated with the Square Zone.



Star Zone
Rectangle Zone
Threshold Value
Select Threshold Zone

Go to the Graph Programming Palette for the Square Zone. Drag a Sound Block into the programming area and select the “Morning” sound file.



What would you expect to happen? Your robot should greet you with “Morning” if it detects you walking through the doorway.
Example 2: Greenhouse Controller
You have a small greenhouse with a temperature sensor, motor A connected to an exhaust fan, and motor B connected to a heat fan.

In this example we use three zones: Star, Square, and Circle. The Threshold Values are set at 20 and 30 degrees Celsius.
Star Zone: Temperature is above 30 degrees Celsius. Turn on Motor A for 10 seconds (exhaust fan).
Square Zone: Temperature is between 20 and 30 degrees Celsius. Do nothing (this is the ideal temperature range).
Circle Zone: Temperature is below 20 degrees Celsius. Turn on Motor B for 10 seconds (heat fan).


What would you expect to happen? When the temperature falls below a certain threshold, the heat fan turns on to warm up the greenhouse. If the temperature goes above another threshold, the exhaust fan turns on to let the warm air out.
Multiple Sensors
When using multiple sensors, each sensor can have up to three Threshold Zones, with Programming Blocks specific to each zone. Click on a sensor in the Select Sensor area to view or edit the Threshold Zones for that sensor.
Graph Programming
Quick links