rpi-io 3.1.4 → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.1.5] - 2026-11-02
4
+ ### Changed
5
+ - README.md: NPM installation script policy
6
+
3
7
  ## [3.1.0] - 2026-07-22
4
8
  ### Changed
5
9
  - log utility refactored
package/README.md CHANGED
@@ -60,6 +60,9 @@ Then log out and log back in.
60
60
 
61
61
  ````bash
62
62
  cd /your-project
63
+ # To allow post-install script to compile C addon
64
+ npm install-scripts approve rpi-io
65
+ # To install module
63
66
  npm install rpi-io
64
67
  ````
65
68
 
@@ -1,6 +1,6 @@
1
1
  # Stepper Motor Extensions
2
2
 
3
- Using the basic **rpi-io** methods for output lines (*write*, *pulseStart*, *pulseStop*), it is easy to drive stepper motors, ranging from simple hobbyist motors (e.g., 28BYJ-48) to those designed for robotics and industrial applications, such as the NEMA series (e.g., NEMA 17, 23...) using some hardware driver (e.g. DMA542).
3
+ Using the basic **rpi-io** methods for output lines (*write*, *pulseStart*, *pulseStop*), it is easy to drive stepper motors, ranging from simple hobbyist motors (e.g. 28BYJ-48) to those designed for robotics and industrial applications, such as the NEMA series (e.g. NEMA 17, 23...) using some hardware driver (e.g. DMA542).
4
4
 
5
5
  To facilitate this type of use, since version 3.1 **rpi-io** has included two stepper motor controller classes:
6
6
 
@@ -21,7 +21,7 @@ PLEASE NOTE:
21
21
 
22
22
  - **Power source for VCC**: for light loads the Pi's 5V pin can drive the ULN2003/motor directly, but the 28BYJ-48 can draw enough current that it's safer to power VCC from a separate 5V supply, keeping only GND common with the Pi.
23
23
 
24
- - The four GPIO pins (17, 18, 27, 22) are just a common convention — any four free GPIO pins work, as long as your code (e.g. via `RPi.GPIO` or `gpiozero`) references the pins you actually wired.
24
+ - The four GPIO pins (17, 18, 27, 22) are just a common convention — any four free GPIO pins work, as long as your code references the pins you actually wired.
25
25
 
26
26
  - The ULN2003 board's output side connects to the motor with its keyed 5-pin connector — it only fits one way, so no wiring decisions needed there.
27
27
 
@@ -67,12 +67,10 @@ motor28BYJF.close()
67
67
 
68
68
  - **coilD** *{Object}* **rpi-io** instance for Coil D
69
69
 
70
- - ##### **mode** *{'half','full'}* sequence mode: half step or full step
70
+ - **mode** *{'half','full'}* sequence mode: half step or full step
71
71
 
72
72
  - **delay** *{Number}* delay in ms between steps
73
73
 
74
-
75
-
76
74
  **Return** *{Object}* StepperUnipolar instance
77
75
 
78
76
 
@@ -82,8 +80,8 @@ motor28BYJF.close()
82
80
  **Parameter(s)**
83
81
 
84
82
  - **steps** *{Number}*
85
- - **direction** *{'forward'|'backward"'*
86
- - **showStep** *{Boolean}* ** to display step in console (default = false)
83
+ - **direction** *{'forward'|'backward'}
84
+ - **showStep** *{Boolean}* to display step in console (default = false)
87
85
 
88
86
  **Return** *{Promise}*
89
87
 
@@ -107,7 +105,7 @@ PLEASE NOTE:
107
105
 
108
106
  - **STEP and DIR switch low to trigger**, since GPIO pulls PUL- or DIR- down relative to the shared +5V.
109
107
 
110
- - **Voltage margin is tight**: the Pi's GPIO output high is 3.3V, but the common rail here is 5V, giving only ~1.7V across the optocoupler when "off" — close to some optocouplers' turn-off threshold. Many builds get away with this, but if you see erratic stepping consider using a Darlington array (e.g. ULN2003) between RPi and DM542.
108
+ - **Voltage margin is tight**: the Pi's GPIO output high is 3.3V, but the common rail here is 5V, giving only ~1.7V across the optocoupler when 'off'. Many builds get away with this, but if you see erratic stepping consider using a Darlington array (e.g. ULN2003) between RPi and DM542.
111
109
 
112
110
  - **ENA+/ENA-** would follow the same common-anode pattern if you wire it — tied into the same 5V junction, with a GPIO pin driving ENA- low to enable.
113
111
 
@@ -161,7 +159,7 @@ bipolar.stop()
161
159
 
162
160
  - **dir** *{Object}* **rpi-io** instance for direction pin
163
161
 
164
- - ##### **edge** *{'desc','asc'}* pulse active edge: descending or ascending
162
+ - **edge** *{'desc','asc'}* pulse active edge: descending or ascending
165
163
 
166
164
  - **width** *{Number}* pulse width and space between two edges in µs
167
165
 
@@ -174,8 +172,7 @@ bipolar.stop()
174
172
  **Parameter(s)**
175
173
 
176
174
  - **steps** *{Number}*
177
- - **direction** *{'forward'|'backward"'*
178
- - **showStep** *{Boolean}* ** to display step in console (default = false)
175
+ - **direction** *{'forward'|'backward'}*
179
176
 
180
177
  **Return** *{Promise<{elapsedMs: number, pulsesCompleted: number, stopped: boolean}>}*
181
178
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rpi-io",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "description": "Nodejs module to control Raspberry Pi GPIO",
5
5
  "keywords": [
6
6
  "raspberry",
@@ -17,7 +17,7 @@ const dir = new RIO(22, "output", {value: 0})
17
17
  const bipolar = new StepperBipolar(pul, dir, "desc", 10)
18
18
 
19
19
  // Start rotating full turn (depending on hardware driver settings)
20
- bipolar.rotate(25600, "forward").then(stepped => {
20
+ bipolar.rotate(6400, "forward").then(stepped => {
21
21
  log("stepped:", stepped)
22
22
  // Reset and close lines
23
23
  pul.write(0)