Python Forum
Orange PI Win steering LEDs connect to GPIO
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Orange PI Win steering LEDs connect to GPIO
#1
Hello
I have Orange PI Win and I would like to the 5 LEDs flash one after the other.
I was able to do it with the usual script below with colleagues help.:

#!/bin/bash

echo 37 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio37/direction
echo 38 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio38/direction
echo 39 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio39/direction
echo 101 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio101/direction
echo 36 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio36/direction

while true; do

#led1	
	echo 1 > /sys/class/gpio/gpio37/value
	sleep 0.25
	echo 0 > /sys/class/gpio/gpio37/value
	sleep 0.01
	
#Led2
	echo 1 > /sys/class/gpio/gpio38/value
	sleep 0.25
	echo 0 > /sys/class/gpio/gpio38/value
	sleep 0.01
	
# led3
	echo 1 > /sys/class/gpio/gpio39/value
	sleep 0.25
	echo 0 > /sys/class/gpio/gpio39/value
	sleep 0.01
	
#led4
	echo 1 > /sys/class/gpio/gpio101/value
	sleep 0.25
	echo 0 > /sys/class/gpio/gpio101/value
	sleep 0.01
#led5
	echo 1 > /sys/class/gpio/gpio36/value
	sleep 0.25
	echo 0 > /sys/class/gpio/gpio36/value
	sleep 0.01
done
But I would like to achieve the same effect written in python.
There are a few other ways to do this, but all the tutorials what I have found on the web are pi raspberry and not my OPI
I work on Armbian and use Geany
Could You advice how to do that?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Seemingly unstable GPIO output while executing from RetroPie LouF 6 291 Feb-19-2021, 06:29 AM
Last Post: LouF
  Picture changing triggered by GPIO q_nerk 2 211 Dec-14-2020, 03:32 PM
Last Post: DeaD_EyE
  GPIO high if network IP has good ping duckredbeard 3 313 Oct-12-2020, 10:41 PM
Last Post: bowlofred
  raspberry pi tank gpio help jatgm1 1 487 May-06-2020, 09:00 PM
Last Post: Larz60+
  Where should I place GPIO.cleanup() shallanq 2 550 Apr-11-2020, 05:02 AM
Last Post: shallanq
  GPIO time in HIGH LOW boris_za 1 569 Dec-07-2019, 01:48 PM
Last Post: Larz60+
  RPi GPIO Flashing LED nickayres 1 956 Jun-07-2019, 01:32 PM
Last Post: gontajones
  Absolute newbie asking for help with blinking LEDs misterfrickel 0 644 Mar-15-2019, 08:54 AM
Last Post: misterfrickel
  GPIO output timing help needed skid 5 1,733 Jan-23-2018, 04:12 PM
Last Post: skid
  Setting GPIO on Raspberry PI using a function jmjasper1 6 2,335 Dec-29-2017, 08:42 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020