This past week, while trying to make composite components using the RoCo interface, I discovered some issues. Before the Summer, Jack had started to work on integrating RoCo with Android devices. This works through an Android App that communicates with the Arduino using Serial. To achieve this, he had added some Serial Components to the RoCo library. One particular component, Serial_in is supposed to accept serial input from the default rx and tx pins on the Arduino and output the data through a buffer of characters. This functionality is encapsulated in the Code Component which has no input, and one SerialOutputPort.

When I tried to add the Serial_in component to the workspace, I noticed that the component graphical block had no output port. After some digging, I found that this was because the back end decides if a component's port is an input port or an output port based on the port's name as opposed to its type. Since Serial_in's port names did not contain the string "in" or "out" in them, they were not displayed in the interface.

The fix for this issue would have been simple if the interface created all the components when loading, since information about whether or not the port is for inputs or outputs would have been readily available. However, creating every component in the library each time the page loaded would have taken too long. Therefore, we use a database which contains minimal information about each of the components to construct the graphical blocks. To rectify this issue, I added information about the port's type to the database. Then, I modified the object that parses the database to include the port's type among its attributes. Following this, I made some changes to the code that generates the Javascript files which define the graphical components to ensure that relevant input and output ports will be shown in the RoCo interface regardless of their names.

Next Post Previous Post