Skip to content

Commit

Permalink
Merge pull request #100 from dtex/gps
Browse files Browse the repository at this point in the history
GPS
  • Loading branch information
dtex committed Jul 5, 2021
2 parents 4ee6e34 + 72bb47e commit 7ea0385
Show file tree
Hide file tree
Showing 90 changed files with 31,065 additions and 26,771 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## j5e Repo Anatomy
One goal of j5e is write once, run anywhere. We are building toward this goal before TC-53 IOCP conformant platforms exist. To that end, the structure of this repo may change to help us support more platforms. The JS is the same across platforms, but the different implementations of ECMAScript Modules may require special concessions (package.json vs manifest.json and varying module resolution schemes for example).
One goal of j5e is write once, run anywhere. We are building toward this goal before ECMA-419 conformant platforms exist. To that end, the structure of this repo may change to help us support more platforms. The JS is the same across platforms, but the different implementations of ECMAScript Modules may require special concessions (package.json vs manifest.json and varying module resolution schemes for example).

### Special Scaffolding
j5e is designed to import just the parts it needs, so subpath exports in node.js are absolutely necessary. To make everything link up you will need to symlink your dev folder to itself. From the root run ```npm link``` and then ```npm link j5e```. This will allow tests to import subpaths, and for subpaths to import their siblings.
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

Control LED's, Servos, Switches, and more with J5e. It runs onboard microcontrollers like the ESP8266. Your code is 100% JavaScript. It does not require node.js, a host server or an SBC to host the app.

J5e is a device framework built upon [ECMA TC-53's](https://www.ecma-international.org/memento/tc53.htm) IO class pattern. The [IO class pattern](https://gist.github.com/phoddie/166c9c17b2f31d0beda9f2410a219268) is a standard interface for accessing underlying hardware interfaces (GPIO). J5e's API is based on the [Johnny-Five](https://github.com/rwaldron.johnny-five) API which has been battle tested over quite some time.
J5e is a device framework built upon [ECMA-419](https://www.ecma-international.org/publications-and-standards/standards/ecma-419/), the Embedded Systems API Specification for ECMAScript. ECMA-419 provides a standard interface for accessing underlying hardware interfaces (GPIO). J5e's API is based on the [Johnny-Five](https://github.com/rwaldron.johnny-five) API which has been battle tested over quite some time.

Currently, the only provider that matches the ECMA TC-53 I/O class pattern is [Moddable's IO module for XS](https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/io/io.md) which runs on the ESP32 and ESP8266. Hopefully, we will see more soon.

*TC-53's emerging standard is still in flux so know there is some risk of changes in the future, but hopefully those changes will be abstracted away by J5e.*
Currently, the only provider that conforms to ECMA-419 is [Moddable's IO module for XS](https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/io/io.md) which runs on the ESP32 and ESP8266. Hopefully, we will see more soon.

**J5e in action**
````js
Expand All @@ -29,14 +27,15 @@ Interested in contributing? Check out [CONTRIBUTING.md](https://github.com/dtex/
<ul>
<li><a href="https://dtex.github.io/j5e/module-j5e_animation.html">Animation</a></li>
<li><a href="https://dtex.github.io/j5e/module-j5e_button.html">Button</a></li>
<li><a href="https://dtex.github.io/j5e/module-j5e_gps.html">GPS</a></li>
<li><a href="https://dtex.github.io/j5e/module-j5e_led.html">LED</a></li>
<li><a href="https://dtex.github.io/j5e/module-j5e_light.html">Light (Photoresistors)</a></li>
<li><a href="https://dtex.github.io/j5e/module-j5e_motor.html">Motor</a></li>
<li><a href="https://dtex.github.io/j5e/module-j5e_relay.html">Relay</a></li>
</ul>
</td>
<td width="50%">
<ul>
<li><a href="https://dtex.github.io/j5e/module-j5e_relay.html">Relay</a></li>
<li><a href="https://dtex.github.io/j5e/module-j5e_rgb.html">RGB LED</a></li>
<li><a href="https://dtex.github.io/j5e/module-j5e_sensor.html">Sensor</a></li>
<li><a href="https://dtex.github.io/j5e/module-j5e_servo.html">Servo</a></li>
Expand Down
6 changes: 3 additions & 3 deletions build/docs/tutorials/C-INSTANTIATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ J5e device instantiation allows for a few different patterns. On one hand we wan
new DeviceClass(ioOptions);
````

The ```ioOptions``` object follows the [TC-53 IO Class Pattern](https://github.com/EcmaTC53/spec/blob/master/docs/tc53.md#9-io-class-pattern) and accepts the same properties described in the individual IO classes. In addition, J5e can accept the `ioOptions.io` property which can be either a path or constructor in the event you do not want to use the default io provider.
The ```ioOptions``` object follows the [ECMA-419 specification](https://www.ecma-international.org/publications-and-standards/standards/ecma-419/) and accepts the same properties described in the individual IO classes. In addition, J5e can accept the `ioOptions.io` property which can be either a path or constructor in the event you do not want to use the default io provider.

*Whoah, what's a provider?*

Expand All @@ -13,7 +13,7 @@ In the physical world a provider is a "thing" (hardware or software) that provid
In code a provider is a bundle of classes that work with that "thing". Providers could come from a board manufacturer, an expander library, an IoT cloud service, an open source hero, or a myriad of other places. For the ESP8266 and ESP32, providers are bundled with the [Moddable SDK](https://github.com/Moddable-OpenSource/moddable), and are part of that SDK's IO module. They give access to the built-in GPIO pins.

## The `ioOptions` object
In TC-53 parlance, an "IO" is a single GPIO (General-Purpose Input/Output) instance. That GPIO Instance could be Digital, PWM, Serial, I2C, SPI or something else. **The ```ioOptions``` options object describes the configuration for the IO instance**. This configuration could include which board to use, which pins, what data rate, etc. The details depend on your situation and provider.
In ECMA-419 parlance, an "IO" is a single GPIO (General-Purpose Input/Output) instance. That GPIO Instance could be Digital, PWM, Serial, I2C, SPI or something else. **The ```ioOptions``` options object describes the configuration for the IO instance**. This configuration could include which board to use, which pins, what data rate, etc. The details depend on your situation and provider.

The options argument is always required and can take a few different forms:
* **Pin Identifier** - This is the simplest scenario and would be a single number or string. J5e will assume the provider is built into the device.io global. The particular type of IO you need will vary by device type. For example, servo would default to ```device.io.PWM```. Button or switch would default to ```device.io.Digital```.
Expand Down Expand Up @@ -91,7 +91,7 @@ The options argument is always required and can take a few different forms:
````

---
* **A TC-53 Peripheral Class Pattern conformant options object** - The [peripheral class pattern](https://github.com/EcmaTC53/spec/blob/master/docs/tc53.md#12-peripheral-class-pattern) allows for explicit description of each of the required IO instances for a device type.
* **An ECMA-419 Peripheral Class Pattern conformant options object** - The [peripheral class pattern](https://github.com/EcmaTC53/spec/blob/master/docs/tc53.md#12-peripheral-class-pattern) allows for explicit description of each of the required IO instances for a device type.
````js
import Motor from "j5e/motor";

Expand Down
4 changes: 3 additions & 1 deletion build/templates/moddable-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
"platforms": {
"esp": {
},
"esp32": {
},
"...": {
"error": "Experimental TC53 IO modules unsupported"
"error": "Experimental ECMA-419 IO modules unsupported"
}
}
}
2 changes: 1 addition & 1 deletion docs/animation_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ <h1><span class="name">animation/index.js</span></h1>
</div>
<footer>
<div class="copyright">Copyright © 2019—2021 The contributors to the j5e and Johnny-Five projects.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
</footer>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/button_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ <h1><span class="name">button/index.js</span></h1>
</div>
<footer>
<div class="copyright">Copyright © 2019—2021 The contributors to the j5e and Johnny-Five projects.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
</footer>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/easing_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ <h1><span class="name">easing/index.js</span></h1>
</div>
<footer>
<div class="copyright">Copyright © 2019—2021 The contributors to the j5e and Johnny-Five projects.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
</footer>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/event_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ <h1><span class="name">event/index.js</span></h1>
</div>
<footer>
<div class="copyright">Copyright © 2019—2021 The contributors to the j5e and Johnny-Five projects.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
</footer>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/fn_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ <h1><span class="name">fn/index.js</span></h1>
</div>
<footer>
<div class="copyright">Copyright © 2019—2021 The contributors to the j5e and Johnny-Five projects.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
</footer>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h1><span class="name">Globals</span></h1>
</div>
<footer>
<div class="copyright">Copyright © 2019—2021 The contributors to the j5e and Johnny-Five projects.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
<div class="generated-by">Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a> using the <a href="https://github.com/steveush/foodoc">FooDoc template</a>.</div>
</footer>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
Expand Down
Loading

0 comments on commit 7ea0385

Please sign in to comment.