Tuesday, June 6, 2023

Brick Buddy Scripting


 After days of working on this I may have made some progress. I had done some scripting work on the Light Buddy 2.  Both use the 40bit (5 bytes) format for a script command.  But it never really worked consistently and in the end I built most of those scripts by hand.  

This is the Script Window in the PC APP.  I have the motor section working.  It provides the ability to attach the corresponding sensor to the motor.  Then you can choose whether to have the motor reverse or stop when the sensor activates.  In a Brick Buddy 3, the sensor will only activate on the state going to ground.  Internally the sensor line is tied to 3.3VDC through a 100K resistor.  I wrote a simple script that turns the motor on and attaches the sensor with Motor Action set to reverse.  It runs until you press the button, which immediately reverses the motor.  This is going to provide some interesting possibilities for MOCs.

Here is the test setup.  A scrap PCB board that I attached four momentary SPST push buttons.  This allows me to test the sensor inputs.

What is missing in the scripting setup is the LED features selection.  I discussed the different LED styles and features in this post.  

On the Main Control Widow, I have a possible solution.  The issue is that the features are not mutually exclusive,  You can have multiple features.  In a traditional Windows Combination Box you can only choose one item.  This picture shows a combination box with individual check boxes for each item.  Thus you area allowed to choose multiple items.  The display of the current selections is not ideal, as you can see to the left of the drop down box.  Also the component does not allow for the drop down box to widen to show the selections.  This feature will require some more research. Ii really did not want to develop my own component, but I may have not other choice.

I did achieve my goal, I have written and installed the script for the Vertical Generator.  The Auto Start now works, so for Brick Fest LIVE, its apply power and it is off and running.  Next task is to do the same for the Vertical Generator.






No comments:

Post a Comment