Skip to content


Direct Pin controll #87

cooltrooper opened this Issue · 4 comments

2 participants


Add a pin object for direct controll of a pin rather than i being wrapped in a device specific class.

ps i dont know how useful the attached code is but I thought i may help.


We could do something similar, but I'd rather make a generic Pin class that initializes "pin control instances"


That sounds useful, would it be a good idea if it had access methods as well as emitting events?


So far...

// will guess that this is digital and assume you mean "input" mode until you write something to it, 
// which it will then automatically switch to "output" mode.
var dig = new five.Pin(13);

// Or manually... (it won't be hex like that)
dig.mode( 0x01 );

// set it high...

// set it low...

// ... which also emits a "high" and "low" event...

// will guess that this is analog... same as above.
var ana = new five.Pin("A0");

I'll keep on working on this later tonight.


That looks good, much simpler than I was making it

@rwaldron rwaldron added a commit that closed this issue
@rwaldron Direct Pin control: new five.Pin(#). Closes gh-87
Signed-off-by: Rick Waldron <>
@rwaldron rwaldron closed this in 0358d43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.