Programming Wink with CodeBender

Wink setup, hardware, basic programming. User to user support.
wclift
Posts: 32
Joined: Sun Feb 07, 2016 6:10 am

Programming Wink with CodeBender

Postby wclift » Thu Mar 31, 2016 6:59 am

In my quest to enable a classroom of students to quickly setup to code for the Wink, I was frustrated at the level of software and driver installation and copying of sketches required to get up and running. It took me awhile to get it working on one PC and then it was still tedious to repeat on several other machines. I wanted to be able to program on a new machine with minimal setup and with easy source code access. In an alternate thread, I described my success getting a Chromebook to work. This thread is to talk about the software side, using https://codebender.cc/home .

Codebender is a full Arduino IDE built into a web browser. With a free login, you can begin to write your own sketches. You can search for existing public sketches as a starting point. You can draw upon a large base of pre-installed libraries (including the NeoPixel library needed by Wink), and you can create and install your own personal libraries as well, so that these can be shared across all of your own sketches. It required a bit of fixing of a few details, but I was able to port all three primary demo programs (BaseSketch, PreLoadedDemo, and IRExample).

So, once you are logged into CodeBender, you can search for my fully functional Wink Sketches, and you can clone and use them instantly. Just search for "Wink_" and you'll start finding them. I made three that exactly match the versions available at PlumGeek. And I created a fourth, Wink_BaseSketch, which has made WinkHardware and FunStuff into libraries that I will share with my other sketches (these have additions I've made on top of the original WinkHardware content).

So, if you'd like to try a different development platform, you can use CodeBender and grab/clone my version of the main programs:
Wink_BaseSketch_Rev01_03
Wink_PreLoadedDemo_Rev01
Wink_IRExample_Rev01_03

You can use Codebender to program from your PC, or you can use it on a Chromebook! No software/drivers needed on the Chromebook. I don't know if you still need the USB/Com driver on the PC. Just install the app in the chrome browser.

Good Luck,
Wayne

steveh
Posts: 3
Joined: Sat Feb 06, 2016 9:07 pm

Re: Programming Wink with CodeBender

Postby steveh » Wed Apr 20, 2016 10:50 pm

I tried this earlier, and it was so close to working. I'm very keen to use the CodeBender approach in school workshops. Anything that doesn't require teachers or IT staff to install anything is to be welcomed!

The problem for me was that, although everything seemed to upload correctly, Wink's lights steadfastly refused to work. It isn't a problem with the robot, because they work fine when I use the IDE. And I've tried accessing CodeBender from a PC and a Mac, so it isn't OS related.

It is more like the lights stick at whatever colour they were when the programmer cable was disconnected. Sometimes they're out entirely and sometimes they are blue, green or whatever. Everything else on the base sketch works, just not the lights.

In CodeBender, how can I check whether I actually have access to the AdaFruit_NeoPixel library?

I found, with a PC running Windows 10 and a Mac on El Capitan, neither needed the FTDI driver for Wink to be programmed from CodeBender.

Steve

wclift
Posts: 32
Joined: Sun Feb 07, 2016 6:10 am

Re: Programming Wink with CodeBender

Postby wclift » Sat Apr 23, 2016 11:33 pm

Hey Steve,
If you don't have access to the AdaFruit_NeoPixel library, then the code should not compile. The functions have to get defined in order to be used by the library functions like eyesBlue().

I took my Wink base sketch and just added a blinking blue eyes routine:
https://codebender.cc/sketch:290995

You should be able to clone this sketch, which only contains the top level .ino file. I'm given to understand that when you clone it, it will ask you if you want to also clone my "personal library", to which you should say YES. That's where I put the FunStuff and WinkHardware files. I've modified all these files minimally to conform with stronger compilation requirements in CodeBender. And this sketch compiles and downloads to my wink and the Adafruit eyes blink perfectly.

Warning: I've modified my setup() function to set eyes red, wait for button, then set eyes green. This allows me, for any program I've previously downloaded, to turn Wink on for programming and not have it jump off the table! All my wink programs now quietly wait for me to hit the go button, so that when I turn it on for programming, it's not doing crazy spin stuff.


Who is online

Users browsing this forum: No registered users and 1 guest