Close

Button block progress (7/3/19)

A project log for Barnabas Robotics ArduBlock Upgrade

An upgrade for ArduBlock

grace-kullGrace Kull 07/04/2019 at 02:050 Comments

Today we managed to complete more tasks on the button block. We added two sockets for the pin number and the button status. At first our block wouldn't fit in the if block test area, but we then figured out that we needed to add a plug connector to the button block so that we could "plug" it into the if block (like a real socket and plug).

I initially changed the HIGH/LOW labels to NOT PRESSED/PRESSED, but then we realized that it would be better to create entirely new NOT PRESSED/PRESSED blocks, as there are other scenarios in which HIGH/LOW would be better to use. We weren't sure how to connect two different blocks in a drop down menu, but eventually figured out that we could put the two in the same family so that the connector block would recognize both blocks as argument options. 

Screenshots of today's work are below:

The corresponding C code when uploading the blocks to Arduino.

Putting the pressed and not-pressed options in the same family so that they could be in the same drop down selection. 

Added the pressed and not-pressed blocks above the original high/low blocks. 

The button block's java file that converts it to C code that can be read by the Arduino. 

Discussions