Coder Social home page Coder Social logo

breadpi's Introduction

BreadPi

BreadPi is a multi-purpose HAT(Hardware Attached on Top) that consists of a mini breadboard on top, ADC, a Programmable Buzzer, Programmable LEDs, push buttons, and 5V tolerant inputs at the Operating Voltage of 3.3V DC at a single place. SB Components developed BreadPi with advanced features like independently controllable LEDs, inputs(Analog & digital), a mini breadboard that helps the user to prototype their projects in an efficient way.

Installation Steps:

  • First enable i2c interface by running "sudo raspi-config" command then select interfacing options >> I2C >> click on enter to enable it.

                                      OR
    
  • You can also use GUI to enable i2c, click on Menu > Preferences > Raspberry Pi Configuration > interfaces, Then enable I2C

  • Install breadpi package on your Raspberry Pi using

pip3 install breadpi

or

python3 -m pip install breadpi

  • import the module with

from breadpi import BreadPi

  • Access PCF8591 or GPIOs directly
bread_pi = BreadPi()

data = bread_pi.read_analog(register=1)  #  Read Data from AIN1

bread_pi.write_analog(register=1, value=100)  #  Covert Digital data to analog
  • To use BreadPi LEDs and buzzer-
bread_pi = BreadPi()
#  To Turn On LEDs use led_on method
#  Use LED number as argument 
bread_pi.led_on('L1')
bread_pi.led_on('L2')
#  Or use Pin numbers
bread_pi.led_on(38)
bread_pi.led_on(40)

#  To Turn Off LEDs use led_off 
#  Use LED number as argument
bread_pi.led_off('L1')
bread_pi.led_off('L2')
#  Or Pin Number
bread_pi.led_off(38)
bread_pi.led_off(40)

#  To Turn On or Turn Off buzzer
#  Use buzzer_on, buzzer_off
bread_pi.buzzer_on()
bread_pi.buzzer_off()

or

  • Take digital inputs from buttons using button function of BreadPi class.
bread_pi = BreadPi()
#  To use switches Of BreadPi
#  use btton function with pin number or switch number of BreadPi as args
status = bread_pi.button('SW1')
status = bread_pi.button(31)

You can pass string printed on BreadPi like, 'L1' or 'SW1' or customized pin number like 29, 31 directly to the functions.

Video Tutorial

breadpi's People

Contributors

satyamthinkgenix avatar sbcshop avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

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.