PartsLibrary is obniz.js included electrical parts software components. By using it, You can use sensors and motors without learning electrical parts. Just use prepared functions and vars.
You can find parts in library
How to use
Use wired() to instantiate a parts class. For example, LED is below.
// Javascript Example
var led = obniz.wired("LED", {anode:0, cathode:1});
led.on();
Code in library
Every parts code are on Github. You can see TypeScript / JavaScript code.
- TypeScript https://github.com/obniz/obniz/tree/master/src/parts
- JavaScript https://github.com/obniz/obniz/tree/master/dist/src/parts
Below is LED example.
- TypeScript https://github.com/obniz/obniz/blob/master/src/parts/Light/LED/index.ts
- JavaScript https://github.com/obniz/obniz/blob/master/dist/src/parts/Light/LED/index.js