

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

[Parts Library](/ja/sdk/parts)

## How to use

Use [wired()](https://obniz.github.io/obniz/obnizjs/classes/obnizcore.obniz.html#wired) to instantiate a parts class. For example, [LED](/ja/sdk/parts/LED/README.md) is below.

```javascript
// 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](https://github.com/obniz/obniz/tree/master/src/parts)
- JavaScript [https://github.com/obniz/obniz/tree/master/dist/src/parts](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](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](https://github.com/obniz/obniz/blob/master/dist/src/parts/Light/LED/index.js)
