View: 75020|Reply: 869

Tutorial How control GPIO whith Android Studio App on Orange Pi 3g and 4g Iot

  [Copy link]

2

threads

4

posts

76

credits

Registered member

Rank: 2

credits
76
Published in 2021-6-17 03:44:59 | Show all floors |Read mode
Edited by cadinodod at 2021-6-17 03:56

Tutorial How control GPIO whith Android Studio App on Orange Pi 3g and 4g Iot

In this tutorial I will show how control GPIO on Orange Pi 3g Iot and Orange pi 4g Iot using Android Studio app .
First you must have full root access, check this post:  Full root access on Orange Pi 3g Iot and Orange Pi 4g Iot

Prerequisites:
     1. Android Studio already installed
     2. An Orange Pi 3g Iot or Orange pi 4g
     3. Jummpers, resistor and Led

Step 1:
1. Creat a Android Studio new project

Step 2:
1. Download the library OrangePi3g4gIot Android

Step 3:
1. Import OrangePi3g4gIotGPIO. Check this post

How use:

  1. /*To toogle a output gpio*/
  2. final DigitalWrite digitalWrite = new DigitalWrite(); //create a gpio output object
  3. digitalWrite.Set(GPIO.GPIO_141_HIGH); // set the state of GPIO141 to HIGH
  4. digitalWrite.Set(GPIO.GPIO_141_LOW); // set the state of GPIO141 to LOW


  5. /* for read gpio*/
  6. final DigitalRead digitalRead = new DigitalRead(GPIO.GPIO_144, GPIO.EN, GPIO.PULLDOWN); //create a gpio input; object the must be have the gpio number, the pull enable (GPIO.EN) and the pull (GPIO.PULLDOWN or GPIO.PULLUP)
  7. digitalRead.getValue() //read the value of GPIO object created ealiry. It is a integer and can be 0 ou 1
Copy code

Code:
Download code

Demo:
Demo Video
Demo Video 2
Demo video 3

0

threads

3

posts

42

credits

Novice

Rank: 1

credits
42
Published in 2021-11-30 17:58:51 | Show all floors
Edited by Kingdom at 2021-11-30 13:11

Hello, I have some questions about your GPIO project for Orange Pi4g iot

1. I have troubles with import your module to Blank Activity project and final sync/build, because multidex  2 (Google maven) repository is not present in my Android  SDK manager for install - Chipmunk Studio 2021.2.1. Canary 5

2. How can I find info about GPIO resources of OrangePi4, not iot version, to make the adaptation of your module for my Opi4 board?
Official page:
http://www.orangepi.org/Orange%20Pi%204/

0

threads

3

posts

42

credits

Novice

Rank: 1

credits
42
Published in 2021-12-3 16:12:35 | Show all floors
Hello again, first issue I fixed myself  due to this article

https://developer.android.google ... dex?hl=en-GB#groovy

Still searchin Opi4 GPIO reference

2

threads

4

posts

76

credits

Registered member

Rank: 2

credits
76
 Author| Published in 2022-1-13 01:32:17 | Show all floors
Kingdom replied at 2021-11-30 17:58
Hello, I have some questions about your GPIO project for Orange Pi4g iot

1. I have troubles with im ...

Hi

I thing in this link: http://www.orangepi.org/download ... 39f316305414ee.html

I hope this can help you

0

threads

4

posts

36

credits

Novice

Rank: 1

credits
36
Published in 2022-1-18 20:12:13 | Show all floors
Thanks for sharing, It was indeed very impressive. Keep sharing stuff like this in future. Also checkout Nulls Brawl Apk.
https://clashmod.net/nulls-clash-apk/

0

threads

1

posts

12

credits

Novice

Rank: 1

credits
12
Published in 2022-5-12 19:30:21 | Show all floors
I really appreciate the kind of topics you post here. Thanks for sharing us a piece of great information that is actually helpful.

3

threads

5

posts

57

credits

Registered member

Rank: 2

credits
57
Published in 2022-7-13 11:44:08 | Show all floors
cadinododPublished in 2022-1-13 01:32
Hi

I thing in this link: http://www.orangepi.org/downloadresources/OrangePi4B/2020-01-03/orangepi ...

404 not found.. please, show me normal link...

3

threads

7

posts

33

credits

Novice

Rank: 1

credits
33
Published in 2022-8-31 16:19:50 | Show all floors
Hello, Would you know if these instructions for 3G and 4G also work for Zero 2?
I would appreciate any help from your expertise in getting gpio working on Zero 2.

0

threads

6

posts

36

credits

Novice

Rank: 1

credits
36
Published in 2023-2-5 21:31:46 | Show all floors
Thanks for sharing the demo videos and code. it worked for me with no issues. Vanced Manager

0

threads

2

posts

14

credits

Novice

Rank: 1

credits
14
Published in 2023-2-22 11:56:47 | Show all floors
i tried android.things(don't support my orange), pi4j a bit (but failed, maybe because of i'm begginer) also i were googling a lot to find something similar with my project.
trap the cat
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list