0.0.1 • Published 3 years ago

@filippoitaliano/gpio-pin-select v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

gpio-pin-select

JavaScript component to select gpio pins with an interface.

Background

Usage

  1. Copy GpioPinSelect.js, radio.svg, radio-checked.svg, default-background.svg, and gpio-pin-select.css in your own project.
  2. Import the component and the styles in your index file:
    <head>
      <script src="GpioPinSelect.js"></script>
      <!-- ... -->
  3. Use the component in your script:
    const mySelect = new GpioPinSelect(properties);
    // ...
    mySelect.destroy();

Open the example.html file in a browser to see a quick demo.


Properties

PropertyDescriptionRequiredDefault
parentNodeThe div in which the component will be appended
onSelectionChangeThe callback called upon radios selectionconsole.log
mappingAlternative mapping for pins positionThe default mapping

Default mapping:

PositionName
13V3
2GP2
3GP3
4GP4
5GND
6GP17
7GP27
8GP22
93V3
10GP10
11GP9
12GP11
13GND
14ID_SD
15GP5
16GP6
17G13
18GP19
19GP26
20GND
215V
225V
23GND
24GP14
25GP15
26GP18
27GND
28GP23
29GP24
30GND
31GP25
32GP8
33GP7
34ID_SC
35GND
36GP12
37GND
38GP16
39GP20
40GP21
0.0.1

3 years ago