Contributing to Circuito


#1

Hi

I was reviewing the code on a simple circuito.io project and noticed the Button class that circuito provides. I was wondering whether the source code is open source and whether we can contribute to it.

I thought it would be nice if the test code showed me the value of each button in the project rather than just “Val:” followed by the value. To do this, the class would need a member variable for the pin it was initialised with (unless the base class, which I can’t find, already provides this of course).

If the code for these things was on Github (or similar) I could submit an issue/feature request, fork, modify, and submit a pull request. Is the team open to such contributions to [hopefully improve] circuito.io?

Thanks
Bernhard


#2

We do share some repos for components that we’ve developed,
they’re all here:

Specifically the button library is not shared however on Github.
We promise - if the demand increases we will share all of them :wink:

Did you see that a button has a ‘read’ method?
//read button state.
bool Button::read()
{
return digitalRead(m_pin);
}


#3

Let me see if I can increase the demand…

the demand

THE DEMAND

##### #    # ######    #####  ###### #    #   ##   #    # #####  
  #   #    # #         #    # #      ##  ##  #  #  ##   # #    # 
  #   ###### #####     #    # #####  # ## # #    # # #  # #    # 
  #   #    # #         #    # #      #    # ###### #  # # #    # 
  #   #    # #         #    # #      #    # #    # #   ## #    # 
  #   #    # ######    #####  ###### #    # #    # #    # #####  

See what I did there? :rofl:


#4

OK, jokes aside now, thank you for sharing those repositories. I’ve looked through a few and the ino files seem to all be lacking test code.

// =========================  TESTCODE // ====================================== 
// {TESTCODE}
    
// {/TESTCODE}
// =========================  END OF TESTCODE // =============================== 

Is the test code generated from another source? If I contribute to OS libraries I like to start with tests or test code because it leads to a better understanding and everyone benefits from better tests.


#5

I feel the demand getting stronger :wink:

Test code is the block of code that we use to generate the main loop in the auto-generated project firmware,
so it’s actually a test code for the component, and not a test block for the driver as in TDD.

This is the main piece of code that runs when you choose the respective component in the serial console when interfacing with the controller.

Not all our components have a driver, and therefore some are missing the test code.