OrangePiLibra / WiringPi

The WiringPi on OrangePi
GNU Lesser General Public License v3.0
58 stars 29 forks source link

OrangePi_2G-IOT: unexpected operator #4

Open GusakIurii opened 6 years ago

GusakIurii commented 6 years ago

I do not understand whether everything is established correctly? Are I / O numbers correct? From the example blink - #define LED 1 - flashing B5 GPIO 37 And to blink B24 GPIO 56, what should I put?

root@OrangePi:~/WiringPi# ./build OrangePi_2G-IOT
Build WiringPi on OrangePi
./build: 11: [: OrangePi_2G-IOT: unexpected operator
wiringPi Build script
=====================

WiringPi Library
[UnInstall]
[Compile] wiringPi.c
[Compile] wiringSerial.c
[Compile] wiringShift.c
[Compile] piHiPri.c
[Compile] piThread.c
[Compile] wiringPiSPI.c
[Compile] wiringPiI2C.c
[Compile] softPwm.c
[Compile] softTone.c
[Compile] softServo.c
[Compile] mcp23008.c
[Compile] mcp23016.c
[Compile] mcp23017.c
[Compile] mcp23s08.c
[Compile] mcp23s17.c
[Compile] sr595.c
[Compile] pcf8574.c
[Compile] pcf8591.c
[Compile] mcp3002.c
[Compile] mcp3004.c
[Compile] mcp4802.c
[Compile] mcp3422.c
[Compile] max31855.c
[Compile] max5322.c
[Compile] sn3218.c
[Compile] drcSerial.c
[Compile] RaspberryPi.c
[Compile] OrangePi.c
OrangePi.c: In function ‘OrangePi_digitalWrite’:
OrangePi.c:692:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
   write(fd, buf, strlen(buf));
   ^
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]

WiringPi Devices Library
[UnInstall]
[Compile] ds1302.c
[Compile] maxdetect.c
[Compile] piNes.c
[Compile] gertboard.c
[Compile] piFace.c
[Compile] lcd128x64.c
[Compile] lcd.c
[Compile] piGlow.c
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]

GPIO Utility
[Compile] gpio.c
gpio.c:754:13: warning: ‘doPadDrive’ defined but not used [-Wunused-function]
 static void doPadDrive (int argc, char *argv [])
             ^
gpio.c:842:13: warning: ‘doGbw’ defined but not used [-Wunused-function]
 static void doGbw (int argc, char *argv [])
             ^
gpio.c:884:13: warning: ‘doGbr’ defined but not used [-Wunused-function]
 static void doGbr (int argc, char *argv [])
             ^
gpio.c: In function ‘doLoad’:
gpio.c:217:4: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
    system(cmd);
    ^
gpio.c:223:4: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
    system(cmd);
    ^
gpio.c:254:4: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
    system(cmd);
    ^
gpio.c:259:7: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
       system(cmd);
       ^
[Compile] extensions.c
[Compile] readall.c
[Compile] pins.c
[Compile] OrangePi.c
[Link]
[Install]

All Done.

NOTE: To compile programs with wiringBP v2, you need to add:
    -lwiringPi
  to your compile line(s) To use the Gertboard, MaxDetect, etc.
  code (the devLib), you need to also add:
    -lwiringPiDev
  to your compile line(s).

root@OrangePi:~/WiringPi# ./build OrangePi_2G-IOT install
Build WiringPi on OrangePi
./build: 11: [: OrangePi_2G-IOT: unexpected operator
wiringPi Build script
=====================

WiringPi Library
[UnInstall]
make: Nothing to be done for 'all'.
[Install Headers]
[Install Dynamic Lib]

WiringPi Devices Library
[UnInstall]
make: Nothing to be done for 'all'.
[Install Headers]
[Install Dynamic Lib]

GPIO Utility
make: Nothing to be done for 'all'.
[Install]

All Done.

NOTE: To compile programs with wiringBP v2, you need to add:
    -lwiringPi
  to your compile line(s) To use the Gertboard, MaxDetect, etc.
  code (the devLib), you need to also add:
    -lwiringPiDev
  to your compile line(s).
GusakIurii commented 6 years ago
root@OrangePi:~/WiringPi/examples# gpio readall
 +-----+-----+----------+------+---+-Orange Pi 2G-IOT+---+---+------+---------+-----+--+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 |     |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |     |
 |  62 |   8 |    SDA.0 |   IN | 0 |  3 || 4  |   |      | 5V       |     |     |
 |  63 |   9 |    SCL.0 |   IN | 0 |  5 || 6  |   |      | 0v       |     |     |
 |  56 |   7 |   GPIO.7 | ALT4 | 0 |  7 || 8  | 0 | IN   | TxD2     | 15  | 72  |
 |     |     |       0v |      |   |  9 || 10 | 0 | IN   | RxD2     | 16  | 71  |
 |  70 |   0 |     RxD1 |   IN | 0 | 11 || 12 | 0 | ALT4 | GPIO.1   | 1   | 37  |
 |  14 |   2 |     TxD1 | ALT2 | 0 | 13 || 14 |   |      | 0v       |     |     |
 |  15 |   3 |     CTS1 | ALT4 | 0 | 15 || 16 | 0 | IN   | GPIO.4   | 4   | 69  |
 |     |     |     3.3v |      |   | 17 || 18 | 0 | IN   | GPIO.5   | 5   | 89  |
 |   4 |  12 |  SPI2_DI | ALT2 | 0 | 19 || 20 |   |      | 0v       |     |     |
 |   3 |  13 | SPI2_DIO | ALT3 | 0 | 21 || 22 | 0 | ALT3 | RTS1     | 6   | 16  |
 |   2 |  14 | SPI2_CLK | ALT3 | 0 | 23 || 24 | 1 | ALT4 | SPI2_CS0 | 10  | 5   |
 |     |     |       0v |      |   | 25 || 26 | 0 | ALT3 | SPI2_CS1 | 11  | 6   |
 |   1 |  30 |    SDA.1 | ALT3 | 1 | 27 || 28 | 1 | ALT3 | SCL.1    | 31  | 0   |
 |  90 |  21 |  GPIO.21 |   IN | 0 | 29 || 30 |   |      | 0v       |     |     |
 |  91 |  22 |  GPIO.22 |   IN | 0 | 31 || 32 | 0 | ALT3 | RTS2     | 26  | 41  |
 |  92 |  23 |  GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v       |     |     |
 |  93 |  24 |  GPIO.24 |   IN | 0 | 35 || 36 | 0 | ALT3 | CTS2     | 27  | 40  |
 |  94 |  25 |  GPIO.25 |   IN | 0 | 37 || 38 | 1 | IN   | SCL.2    | 28  | 38  |
 |     |     |       0v |      |   | 39 || 40 | 1 | IN   | SDA.2    | 29  | 39  |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+-Orange Pi 2G-IOT+---+------+----------+-----+-----+
GusakIurii commented 6 years ago

Only PIN 1 (# 37) is turned on and off

root@OrangePi:~/WiringPi/examples# ./blink8
Raspberry Pi - 8-LED Sequencer
==============================

Connect LEDs to the first 8 GPIO pins and watch ...
ERROR: can't operate GPIOC-25
ERROR: can't operate GPIOC-6
ERROR: can't operate GPIOC-5
ERROR: can't operate GPIOC-25
ERROR: can't operate GPIOC-6
ERROR: can't operate GPIOC-5

----------------------------------
----------------------------------
---------------------------------
tjitra commented 6 years ago

me too. useless library im uninstall it GPIO.1 is to control USB (for extended) u can only use GPIO.7 for this time. w8 for long time, but no clue how to use thats GPIO.