Page 1 of 1

OOP with Ringo

Posted: Mon Dec 07, 2015 8:39 am
by mikasami

I wanted to practice some OOP in Arduino and Ringo is the right motivation for doing so :D
I'm still getting started,

Here is my code so far:

and you can follow the repository here:


Re: OOP with Ringo

Posted: Tue Dec 08, 2015 1:36 am
by mikasami
Wanting to understand Ringo a little better, I decided to try to make a simple library for Ringo. it's probably a little bit slower compared to the official one, but I'm just doing this for the sake of learning...

I've implemented a few classes (motors, lightsensors, piezo, sweeper, metronome)

I'm going to implement buttons, and neopixels next..and correct me if I'm wrong... but I didn't see the button debounced? Did you find it uneccessary based on your testing?

I don't really understand the computations of the 6 IMU sensors yet, how you compute the location in the x,y axes and stuff like that based on the readings...Can you point me somewhere so I can understand how the mathematics work? thanks :)

I almost just copied your implementation of playChirp in my piezo.. without really understanding it too much as well. :(

Re: OOP with Ringo

Posted: Fri Dec 11, 2015 4:38 pm
by Kevin

Glad to see someone jumping in here for some more advanced stuff. I'm sorry I don't know what "OOP" is though. ??

Most of the code was written by a friend of ours Dustin. It is not documented any further than what is in the code. Good luck. :D I know he did some tricks with bit shifting to avoid long computations. I also know he did something regarding the gyro where he only calculates for 90 degrees then off sets the value - so the computation can take place in a smaller space then the result is multiplied out for the other three 90 degree slices. (Something to that effect anyway).

I would very much appreciate your help in giving it a second look.