OOP with Ringo

Discussion where advanced users can discuss improvements to Ringo's background functions and underlying code. Your help appreciated!
mikasami
Posts: 11
Joined: Tue Sep 15, 2015 3:37 pm

OOP with Ringo

Postby mikasami » Mon Dec 07, 2015 8:39 am

Hi!

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:

https://gist.github.com/mithi/0b35252d97db67f8b465

and you can follow the repository here:

https://github.com/mithi/ringo-basic

Thanks!

http://arduinobootcamp.xyz

mikasami
Posts: 11
Joined: Tue Sep 15, 2015 3:37 pm

Re: OOP with Ringo

Postby mikasami » Tue Dec 08, 2015 1:36 am

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)

https://github.com/mithi/ringo-basic

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. :(

Kevin
Posts: 137
Joined: Tue Jul 28, 2015 12:56 am

Re: OOP with Ringo

Postby Kevin » Fri Dec 11, 2015 4:38 pm

mika-

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.


Who is online

Users browsing this forum: No registered users and 1 guest