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.


#6

Heya,
we’re now slowly releasing the central repo that we use to maintain the code (and all the component info), you can sneak peek at the code section, it’s here https://github.com/Circuito-io/ComponentEditor/tree/master/components/Coders
Let me know if that is what you were hoping for!


#7

That makes it clear that the comp components are independent and unaware of one another which means we can’t do what I had in mind.

It’s still great to see what you’ve done and hopefully we can contribute pull requests of we find bugs or have ideas to improve things.


#8

Hi eyal

I’ve made a pull request for review. Would contributions like this be welcome, or is there another way I can offer (IMO) improvements to the code?

Thank you
Bernhard


#9

Of course, that’s perfect! You have given us the honor by becoming our first contributor!
We’ll review the modification and merge it when it’s ready to the master branch.

You’re the best!


#10

Hello @eyal. My name’s Alex. I’m an Advanced Robotics Teacher here in Atlanta, GA, USA, specializing on Arduino-based robots. I’ve actually written a lot of test code for quite a bit of the components on your site. (I use this site mostly to guide my students, ages 10 - 16, on how to wire things, and look forward to using your PCB Design Tool one day). Anyway, is there a way I can submit some sketches for review? It’ll take some time to compile everything, but I want to atleast submit code for the components I’ve worked with, (ie. U-Blox M6 GPS Module, 3 DOF Compass, DFPlayer MP3 Module, AMG8833 Thermal Camera, MQ-2 Gas Sensor, and more). I don’t mind notating pinouts, wiring, and adding comments (I’ve done a lot of that already). Just let me know.


#11

@ScienceGlobally Nice to meet you!
Of course we would appreciate your contribution,
you can see the current code libraries we offer here,
If you think that there’s an existing component where your code can improve on, please add it via the normal github pull-request flow. If there’s a missing component in our system, we need to first add it before you can contribute the code otherwise you won’t be able to test the resulting code.
In this case, you can create an issue on our issue tracking system asking for the new component.
Let me know if you have any more questions and welcome to our community!