Code Monkey home page Code Monkey logo

lib-bbb's Introduction

#"Capemgr" for BeagleBone Black

C api for BeagleBone Black, functions for gpio, analog, pwm, i2c, serial and bbb tool and more...

bbb:

  BeagleBone Black                                                
  ----------------                                                
                                                                  
  --show-all                                                      
  --show-pin <P[HEADER]_[NUM]>                                    
  --show-by-type <type>                                           
  --show-by-type-only <type>                                      
  --show-types                                                    
                                                                  
  --enable-adc                                                    
  --get-adc <id>                                                  
                                                                  
  --i2c-scan <bus>                                                
  --enable-i2c-device <bus>                                       
     --address <address>                                          
     --module <module>                                            
                                                                  
  --disable-i2c-device <bus>                                      
     --address <address>                                          
                                                                  
  --enable-gpio <gpio>                                            
  --enable-gpio-pin <P[HEADER]_[NUM]>                             
  --disable-gpio <gpio>                                           
  --disable-gpio-pin <P[HEADER]_[NUM]>                            
                                                                  
  --gpio <gpio>                                                   
  --gpio-pin <P[HEADER]_[NUM]>                                    
     --set-direction <0 | 1>                                      
     --get-direction                                              
     --set-value <0 | 1>                                          
     --get-value                                                  
                                                                  
  --enable-pwm <P[HEADER]_[NUM]>                                  
  --pwm <P[HEADER]_[NUM]>                                         
     --set-period <time>                                          
     --set-period-hz <x[Hz][kHz][MHz]>                            
     --set-duty <[0-100]>                                         
     --set-polarity <0 | 1>                                       
     --get-period                                                 
     --get-duty                                                   
     --get-polarity      
                                     
  --enable-serial <[0-5]>
                                                                  
Examples:                                                         
                                                                  
sudo bbb --enable-adc                                             
sudo bbb --get-adc 2                                              
                                                                  
sudo bbb --enable-i2c-device 1 --address 0x53 --module adxl34x    
sudo bbb --i2c-scan 1                                             
sudo bbb --disable-i2c-device 1 --address 0x53                    
                                                                  
     bbb --show-all                                               
     bbb --show-pin P8_13                                         
     bbb --show-by-type-only pwm                                  
                                                                  
sudo bbb --enable-gpio 60                                         
sudo bbb --gpio 60 --set-direction 1                              
sudo bbb --gpio 60 --get-direction                                
sudo bbb --gpio 60 --set-value 1                                  
sudo bbb --gpio 60 --get-value                                    
sudo bbb --disable-gpio 60                                        
                                                                  
sudo bbb --enable-pwm P8_13                                       
sudo bbb --pwm P8_13 --set-period 1000000000                      
sudo bbb --pwm P8_13 --set-period-hz 50Hz                         
sudo bbb --pwm P8_13 --set-duty 100                               
sudo bbb --pwm P8_13 --get-period --get-duty                      
sudo bbb --pwm P8_13 --set-polarity 0 

sudo bbb --enable-serial 2

Build:

git clone https://github.com/vmolsa/lib-bbb
cd lib-bbb
make
sudo make install

Linking

gcc -o progname main.c ../lib-bbb/lib-bbb.a
gcc -o progname main.c -l-bbb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.