
Select GPIO to add a new GPIO definition. A popup menu appears with multiple IO options.
Note that by default two GPIO definitions, 'gpio1' and 'gpio2', are predefined.Īt the bottom of the IO Definitions section, click the '+' button. Examples of such functions are tx_gpio_pin_get(), tx_gpio_pin_set() for getting and setting a general-purpose IO pin, tx_delay_millis() for introducing delays in the program, and tx_adc_read() to read the value from an analog-to-digital converter.Ĭlick on the Application component to select it, and in the Properties panel, locate the IO Definitions section. After setting up these definitions, C API functions are provided that can be called from the external application to communicate with Studio Technix. This is achieved by defining a set of IO Definitions in the Properties panel of the Application component. To exchange data between the application and the simulation model in Studio Technix, a so called simulation interface must be set up. In this case the external application will be a program written in C-code that contains the logic to control the lights of the intersection. The purpose of the Application component is to couple an external application to a simulation model in Studio Technix. Drag the Application component onto the Diagram to the bottom left of the intersection. In the Component Library panel, in the Target Library, locate the Application component ( ). Remove the Counter ( ) and both Formula ( ) components. Download the initial project files to get started. The starting point of this tutorial is the traffic light model of the previous tutorial.
Defining a simulation interface for the C-code program The program will be developed and tested by coupling it to the simulation model of the traffic lights in Studio Technix. The predefined light sequence will be replaced by a custom program in C. The starting point of this tutorial is the Traffic Light Model project of the Traffic Light Model tutorial. The controller is an application written in C-code that determines the state of the traffic lights based on a sensor that detects whether cars are present or not. In this tutorial you will create a controller for traffic lights at an intersection.
Note: these docs are for the alpha version of Studio Technix (Released May 2021).ĭocumentation will be updated when the early-adopter program becomes public.