|
|
|
|
@ -16,7 +16,7 @@ child_process.exec('pinctrl set 6 op');
|
|
|
|
|
child_process.exec('pinctrl set 13 op');
|
|
|
|
|
child_process.exec('pinctrl set 19 op');
|
|
|
|
|
|
|
|
|
|
app.post('/on/:gpio', function (req, res) {
|
|
|
|
|
app.use('/on/:gpio', function (req, res) {
|
|
|
|
|
|
|
|
|
|
const gpio = req.params.gpio;
|
|
|
|
|
const command = `pinctrl set ${gpio} pn dh`;
|
|
|
|
|
@ -32,7 +32,7 @@ app.post('/on/:gpio', function (req, res) {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.post('/off/:gpio', function (req, res) {
|
|
|
|
|
app.use('/off/:gpio', function (req, res) {
|
|
|
|
|
|
|
|
|
|
const gpio = req.params.gpio;
|
|
|
|
|
const command = `pinctrl set ${gpio} dl`;
|
|
|
|
|
@ -48,7 +48,7 @@ app.post('/off/:gpio', function (req, res) {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.get('/status/:gpio', function (req, res) {
|
|
|
|
|
app.use('/status/:gpio', function (req, res) {
|
|
|
|
|
|
|
|
|
|
const gpio = req.params.gpio;
|
|
|
|
|
const command = `pinctrl get ${gpio}`;
|
|
|
|
|
|