[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 574: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 630: sizeof(): Parameter must be an array or an object that implements Countable
Plum Geek Forum • Wink Programming Question: Function Reference Manual
Page 1 of 1

Wink Programming Question: Function Reference Manual

Posted: Sun Feb 07, 2016 7:12 am
by wclift
Now that I'm up and coding for Wink, I have a very basic question. Each of the programming exercises introduces new functions. I'm looking for a more complete reference manual of all available functions and operations.

Where can I find the Language Reference Manual for Wink (or Ringo)?

Re: Wink Programming Question: Function Reference Manual

Posted: Thu Feb 11, 2016 6:55 pm
by Kevin
Unfortunately we don't have a full reference manual published just yet but we'll get there. As we've written the lessons we've been making up or tweaking the functions as we're going. Once the lessons are complete I will produce a functions reference. We will introduce function writing in the next couple lessons so you'll be able to start writing your own. (It's pretty easy to do anyway - just dig around for Arduino Functions if you're interested).

Ringo is a similar way with the Ringo Guide introducing most of them.

On both robots you can look in the tabs ending in ".h" in Arduino to see declarations of all the existing functions.

Another note, if you do want to start doing your own code, have a look at the tab named WinkHardware.h - toward the top is the defines for each pin on the Wink. You can use these pin names along with the standard Arduino functions for interacting with the pins (like analogRead, digitalWrite, etc). If you need a copy of the schematic, contact me through the contact form on the PG website and I'll email a copy. (It's not on gitHub yet because I need to clean it up a bit - another thing to hopefully finish soon) but I can send you what I have which is 99% complete and ready.

On Ringo, we wrote all the functions with a naming convention starting with a capital letter, like Motors(). This was a convention I adopted a long time ago where I'd capitalize a function name to indicate to myself that I wrote it custom and it wasn't a standard function. It was pointed out to me by a few helpful people that this isn't standard naming convention once the Ringo was out and the guide was written. So I wrote the Wink functions using the more standard "first word lower case" naming convention like motors();.

Of course this now causes confusion as both aren't the same. Once the Wink lessons are complete, I'm going back and creating a new version of the Ringo Base Sketch with the naming convention changed to the lower case standard. I'll leave behind "wrapper" functions with the old convention so old code will still run, but I'll update the Ringo guide with the new conventions (need to make a few changes in that guide anyway).

That's a project I hope to have complete in the next couple months but eventually they'll all be the same an nice and pretty.

Re: Wink Programming Question: Function Reference Manual

Posted: Fri Feb 12, 2016 2:25 am
by sil
While there is still limited references for Ringo or Wink at the moment, Google can help you out greatly. Accessing Ringo and Wink's hardware is easy enough to find but how to work with the values and do things is not really specific to the hardware so you can find help in many places. For example you might read values from a sensor and notice they fluctuate a little (reading a sensor and outputing to the serial port are in the plumgeek documents), but you might want to get an average value instead which wont fluctuate so much (i dont think you can find this in plumgeek's docs yet) so do a websearch for "arduino averaging" and you'll find information that will work on Ringo and Wink as they are arduino based. so if you are trying to work out how to do something then searching google or bing etc for arduino plus what you want to know will help you out a lot. It's the same code until you hit the hardware specific references.