Hi!

I wanted to practice some OOP in Arduino and Ringo is the right motivation for doing so

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

## OOP with Ringo

### Re: OOP with Ringo

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.

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.

### Re: OOP with Ringo

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

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. 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 3 guests