Author: linga51

GPIO library - WiringPi

[Copy link]

5

threads

12

posts

214

credits

Intermediate member

Rank: 3Rank: 3

credits
214
Published in 2017-2-14 21:37:01 | Show all floors
Hello,

This is compatible with orange pi zero (13*2 pinout) ?

0

threads

2

posts

20

credits

Novice

Rank: 1

credits
20
Published in 2017-2-28 01:57:41 | Show all floors
Please give me a code to blinking led in orange pi lite.
I have installed wiringOPi library.

2

threads

30

posts

250

credits

Intermediate member

Rank: 3Rank: 3

credits
250
Published in 2017-3-2 18:51:36 | Show all floors
#include <stdio.h>
#include <wiringPi.h>

#define BLINK_LED 29  //led on port 29

int main()
{
   wiringPiSetup () ;
    pinMode (BLINK_LED, OUTPUT);  //led  

while(1)
{
digitalWrite(BLINK_LED, HIGH);
delay(500);
digitalWrite(BLINK_LED, LOW);
delay(500);
}
}

0

threads

1

posts

16

credits

Novice

Rank: 1

credits
16
Published in 2017-3-23 10:29:51 | Show all floors
Hello all
I have a Orange pi run Android OS. Please teach me how to use WitingOP for android. I connect GPIO to button and i want build application read event button pressed.
Somebody please help me.
Sorry my english is very bad

0

threads

3

posts

20

credits

Novice

Rank: 1

credits
20
Published in 2017-3-25 06:02:06 | Show all floors
For standalone PWM (not using Wiring PI). It uses UART0_RX pin on the UART breakout header.

https://github.com/iboguslavsky/pwm-sunxi-opi0.git

Have a look at the examples also.

10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2017-3-31 18:16:42 | Show all floors
Edited by nopnop2002 at 2017-4-1 23:48
iboguslavsky replied at 2017-3-25 06:02
For standalone PWM (not using Wiring PI). It uses UART0_RX pin on the UART breakout header.

https: ...

Thank you so much for your sharing this wonderful project ...
It's can control my servo-motor(SG90)

  1. #!/bin/bash
  2. #enable pwm
  3. echo 1 > /sys/class/pwm-sunxi-opi0/pwm0/run
  4. sleep 1

  5. #set prescale to 200KHz
  6. cat /sys/class/pwm-sunxi-opi0/pwm0/prescale
  7. echo 0 > /sys/class/pwm-sunxi-opi0/pwm0/prescale
  8. sleep 1

  9. #set entirecycle to 4000
  10. cat /sys/class/pwm-sunxi-opi0/pwm0/entirecycles
  11. echo 4000 > /sys/class/pwm-sunxi-opi0/pwm0/entirecycles
  12. sleep 1

  13. #Move to Center
  14. #cat /sys/class/pwm-sunxi-opi0/pwm0/activecycles
  15. echo 290 > /sys/class/pwm-sunxi-opi0/pwm0/activecycles
  16. sleep 1

  17. #Move to Angle -90
  18. echo 125 > /sys/class/pwm-sunxi-opi0/pwm0/activecycles
  19. sleep 1

  20. #Move to Angle +90
  21. echo 470 > /sys/class/pwm-sunxi-opi0/pwm0/activecycles
  22. sleep 1

  23. #Move to Center
  24. echo 290 > /sys/class/pwm-sunxi-opi0/pwm0/activecycles
  25. sleep 1

  26. #disable pwm
  27. echo 0 > /sys/class/pwm-sunxi-opi0/pwm0/run
Copy code
I have decided to write the wrap function by a C language.

https://github.com/nopnop2002/pwmlib-opi
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list