Skip to content

afawcett/apex-littlebitsapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

apex-littlebitsapi

Deploy to Salesforce

An Apex wrapper around the LittleBits Cloud API. LittleBits is a very cool way to creating Internet of Things devices! I was lucky enough to get given a Cloud Starter Kit recently from Salesforce through the MVP program, thank you! And of course could not resist calling its API from Apex, to connect my new device up to my favourite cloud!

Deploy the code and setup the Custom Setting or pass the Access Token and Device ID to the API directly. The following code uses the Custom Setting to obtain the token and device Id, then sends 80% voltage for 10 seconds to the device.

  • If the LED is connected it shines at 80% for 10 seconds
  • If the Servo is connected (in swing mode) it swings at 80% speed back and forth for 10 seconds.
new LittleBits().getDevice().output(80, 10000);

This API now supports the subscribe and unsubscribe resources.

If #clicksnotcode is your thing, there is an integration with Chatter via IFTTT here. I am also working on a LittleBits Connector here.

About

An Apex wrapper around the LittleBits Cloud API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages