2
This commit is contained in:
parent
170cbb7792
commit
1413decbe0
@ -14,7 +14,7 @@ pins.forEach(pin => {
|
||||
|
||||
|
||||
// Function to toggle a pin on-then-off
|
||||
function togglePin(pin, callback) {
|
||||
export function togglePin(pin, callback) {
|
||||
exec(`python3 src/python/gpio_interface.py toggle ${pin}`, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
return callback(error);
|
||||
@ -27,7 +27,7 @@ function togglePin(pin, callback) {
|
||||
}
|
||||
|
||||
// Function to sense a pin state
|
||||
function sensePin(pin, callback) {
|
||||
export function sensePin(pin, callback) {
|
||||
exec(`python3 src/python/gpio_interface.py sense ${pin}`, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.error(`Error sensing pin ${pin}: ${error.message}`);
|
||||
@ -43,7 +43,7 @@ function sensePin(pin, callback) {
|
||||
}
|
||||
|
||||
// Toggle pins sequentially and then sense pin states
|
||||
function debugInit() {
|
||||
export function debugInit() {
|
||||
pins.forEach(async (pin) => {
|
||||
switch (pin.mode) {
|
||||
case 'OUT':
|
||||
|
@ -1,8 +1,4 @@
|
||||
// Import modules
|
||||
import gpio from './custom_modules/VoidGPIO.js';
|
||||
|
||||
// List of pins for toggling
|
||||
const togglePins = [7, 13];
|
||||
// List of pins for sensing
|
||||
const sensePins = [16, 22];
|
||||
const gpio = require('./custom_modules/VoidGPIO.js');
|
||||
|
||||
gpio.debugInit();
|
Loading…
Reference in New Issue
Block a user