Other languages

WiringBP Banana Pro Compile

16 1527
kneiser  
Edited by kneiser at Feb 08, 2016 13:44

At the end of the WiringBP build there is a "Note" that states to use some sort of option for V2 will be required.

I can only assume the first build I did will only support 26 GPIO pins rather than the full 40 pins on the GPIO header? I have successfully tested with the current build but only with in the 26 pins.

So is there something that needs to be done differently for V2?

ATTN: @tony_zhang - as a contributor for this library on GitHub are you able to answer this please?
kneiser  
Edited by kneiser at Feb 08, 2016 13:45

@tony_zhang - As on of the contributors on GitHub for WiringBP for the Banana Pi Pro can you answer this?

kneiser  
@tony_zhang

There are two branch in WiringBP, one for banana pro (40pin) and one for banana pi(26pin). So when you use git to download the source code, you can use "git checkout" to change the branch.

kneiser  
Edited by kneiser at Feb 10, 2016 08:57

@tony_zhang
I cloned and compiled from GitHub: git clone https://github.com/LeMaker/WiringBP.git -b bananapro

After the compile there was a message at the end indicated some sort of compile option (-something) had to be added for a "v2" compile. So does the v2 message mean support for a gpio header of 40 pins or 26? Or is this message for something else?

I tested the the compiled library by setting gpio out and a voltmeter. The library works up to physical gpio header pin 26. I tried a gpio header pin 40 as an out and could not get any reading with the voltmeter. So I can only assume I misunderstand the pin 40 function or the library is not supporting anything beyond pin 26.

Your guidance will be appreciated.

cyryllo  
Edited by cyryllo at Feb 11, 2016 22:17

Today i work on BananaLMK and softPwm not working. I back to WiringBP and PWM work. But no work Pull up and down correctly on LN Digital in C lib (on LMK and BP). When send Pull_Up can't change to Pull_Down
And when use for() and input var function pullUpDnControl not work.
  1. #include <stdio.h>
  2. #include <wiringPi.h>
  3. #include <mcp23s17.h>

  4. #define BASE    100

  5. int main (void)
  6. {
  7.   int i, wart;

  8.   wiringPiSetup () ;
  9.   mcp23s17Setup (BASE, 0, 0) ;

  10.   printf ("LN Digital - Test\n") ;

  11.   for (i = 0 ; i < 8 ; ++i){
  12.     pinMode (BASE + i, OUTPUT) ;
  13.      
  14. }

  15. for (i = 0 ; i < 8 ; ++i){
  16.     digitalWrite (BASE + i, 1) ;
  17.     delay (300);
  18. }
  19.     delay (500);
  20. for (i = 7 ; i >= 0 ; --i){
  21.     digitalWrite (BASE + i, 0) ;
  22.     delay (400);
  23. }
  24. for (i = 8 ; i > 16 ; ++i){
  25.   pinMode         (BASE + i, INPUT) ; // <-not work
  26.   pullUpDnControl (BASE + i, PUD_UP) ; // <- not work
  27. }
  28. for (i = 8 ; i < 16 ; ++i){
  29.       wart = digitalRead (BASE + i);
  30.       printf ("Pin input nr %d wartosc: %d\n", i - 8 , wart) ;
  31.       delay (100) ;
  32. }
  33.   return 0 ;
  34. }
Copy the Code

but when I change to
  1. pinMode         (108, INPUT) ;
  2. pullUpDnControl (108, PUD_UP) ;
  3. .....
  4. ....
  5. ....
  6. pinMode         (115, INPUT) ;
  7. pullUpDnControl (115, PUD_UP) ;
Copy the Code
then it works and change input to Pull_UP (but can't change to Pull_down)
  1. pullUpDnControl (108, PUD_DOWN) ;
Copy the Code
in command gpio can change Up>Down and Down>Up
  1. gpio -x mcp23s17:100:0:0 mode 108 in
  2. gpio -x mcp23s17:100:0:0 mode 108 up
  3. gpio -x mcp23s17:100:0:0 read 108
  4. 1
  5. gpio -x mcp23s17:100:0:0 mode 108 down
  6. gpio -x mcp23s17:100:0:0 read 108
  7. 0
Copy the Code

@tony_zhang can you check?

Overall, in new version of library WiringPi has been disabled  softServo (I cant manual add to Makefile).
Whare can download WiringBP v1 lib?

  1. pinMode         (BASE + i, INPUT)
Copy the Code


This code is not support in WiringBP.

pullUpDnControl (108, PUD_DOWN) ;  
We need test, because we encounter this problem before, but we correct this.

Edited by alessia.cao at Feb 22, 2016 01:16

Hi, I tested for the normal pins on Banana Pro, it works for this function. It can be problems of the mcp23s17 files.

  1. #include <stdio.h>
  2. #include <wiringPi.h>

  3. #define LED     1

  4. int main (void)
  5. {
  6.   int wart;
  7.   wiringPiSetup () ;
  8.   pinMode (LED, INPUT) ;
  9.   pullUpDnControl (LED, PUD_UP);
  10.   wart = digitalRead (LED);
  11.   printf ("Pin input nr %d wartosc: %d\n", LED, wart) ;

  12.   pullUpDnControl (LED, PUD_DOWN);
  13.   wart = digitalRead (LED);
  14.   printf ("Pin input nr %d  wartosc: %d\n", LED, wart) ;

  15.   return 0 ;
  16. }
Copy the Code


tony_zhang replied at Feb 21, 2016 19:34
This code is not support in WiringBP.

pullUpDnControl (108, PUD_DOWN) ;  

pinMode         (BASE + i, INPUT) is fine, no problem.

cyryllo  
Edited by cyryllo at Feb 22, 2016 13:20

Yes on normal pin in pro work but not work with  mcp23s17  and LN Digital
Not work function pullUpDnControl

You have to log in before you can reply Login | Sign Up

Points Rules