Saravanan666/pypi-org huggingface dataset:
Package: raspberrypi-tm1637
TM1637Raspberry Pi Python 3 TM1637A Python 3 port from MicroPython library for the quad 7-segment LED display modules based on the TM1637 LED driver, implemented on Raspberry Pi.For example, theGrove - 4 Digit Display moduleInstallationThis project is available throughpip. Make sure that you are using Python 3.$ pip3 install raspberrypi-tm1637ExamplesBasic usageimporttm1637tm=tm1637.TM1637(clk=5,dio=4)# all LEDS on "88:88"tm.write([127,255,127,127])# all LEDS offtm.write([0,0,0,0])# show "0123"tm.write([63,6,91,79])# show "COOL"tm.write([0b00111001,0b00111111,0b00111111,0b00111000])# show "HELP"tm.show('help')# display "dEAd", "bEEF"tm.hex(0xdead)tm.hex(0xbeef)# show "12:59"tm.numbers(12,59)# show "-123"tm.number(-123)# show temperature '24*C'tm.temperature(24)For more detailed examples, seedemo.pySeven Segment FontThey are called 7-segment displays as there are 7 LEDs for each digit (segment).
One byte (7 lower bits) for each segment. The 8th bit (MSB) is for the colon and only on the 2nd segment.A
     ---
  F |   | B   *
     -G-      H (on 2nd segment)
  E |   | C   *
     ---
      D

  HGFEDCBA
0b01101101 = 0x6D = 109 = show "5"DisplayBinHexDec00b001111110x3F6310b000001100x06620b010110110x5B9130b010011110x4F7940b011001100x6610250b011011010x6D10960b011111010x7D12570b000001110x07780b011111110x7F12790b011011110x6F111A0b011101110x77119b0b011111000x7C124C0b001110010x3957d0b010111100x5E94E0b011110010x79121F0b011100010x71113G0b001111010x3D61H0b011101100x76118I0b000001100x066J0b000111100x1E30K0b011101100x76118L0b001110000x3856M0b010101010x5585n0b010101000x5484O0b001111110x3F63P0b011100110x73115q0b011001110x67103r0b010100000x5080S0b011011010x6D109t0b011110000x78120U0b001111100x3E62v0b000111000x1C28W0b001010100x2A42X0b011101100x76118y0b011011100x6E110Z0b010110110x5B91blank0b000000000x000-0b010000000x4064*0b011000110x6399MethodsGet or set brightness.brightness(val=None)Write one or more segments at a given offset.write(segments,pos=0)Convert a single hex digit (0x00-0x0f) to a segment.encode_digit(digit)Convert a string to a list of segments.encode_string(string)Convert a single character to a segment.encode_char(char)Display a number in hexadecimal format 0000 through FFFF.hex(val)Display a number -999 through 9999, right aligned.number(num)Display 2 independent numbers on either side of the (optional) colon, with leading zeros.numbers(num1,num2,colon=True)Display a temperature -9 through 99 followed by degrees C.temperature(num)Show a string on the display.
Shorthand forwrite(encode_string()).
Limited to first 4 characters.show(string,colon=False)Display a string on the display, scrolling from the right to left, speed adjustable.
String starts off-screen and scrolls until off-screen at 4 FPS by default.scroll(string,delay=250)PartsGrove 4 Digit Display$5.90 USDGrove Male Jumper Cable$2.90 USDConnectionsRaspberry Pi4 Digit DisplayGPIO5CLKGPIO4DIO3V3 (or 5V)VCCGNDGNDLinksTM1637 datasheetNokia 5110 versionBBC micro:bit versionLicenseLicensed under theMIT License.
Package: raspberry-py
Please see theproject websitefor more information.Python Interface for GPIO CircuitsThis package provides two related capabilities.First, it provides a high-level, event-driven Python
interface for GPIO circuits running on the Raspberry Pi. Sensors, motors, LEDs, switches, and many other components are
covered. An example is shown below (click to watch; Python codehere):Remote Control of GPIO Circuits via REST/HTML/JavaScriptSecond, this package enables remote control of GPIO
circuits via REST APIs invoked from HTML/JavaScript front-ends. Want to control your circuit remotely from your phone?
Look no further. This package auto-generates HTML/JavaScript for GPIO circuits based onMaterial Design for Bootstrap. These HTML/JavaScript elements can be embedded in full web
pages for remote control of the circuit. The remote control screen for theFreenove Smart Caris shown below:The smart car is built from the same components (sensors, motors, LEDs, etc.) listed above, making development quite
straightforward. As another example, considerthe 3D-printed robotic armthat I
designed for the car.Please see theproject websitefor more information.
Package: raspberry-sensors
RaspberryPi Sensors LibraryThis library provides functions to retrieve data from mh_z19, DHT, and ads1015 sensors on a Raspberry Pi. Note that in case of errors, no exceptions are thrown, and the cached sensor value is also returned in case of an error.Usage ExamplesInitializationFirst, import the library and create an instance of theSensorsclass.fromraspberry_sensorsimportSensorssensors=Sensors()Disabling Error LoggingYou can disable error logging by passing thelogging_errorparameter equal toFalsewhen creating an instance of theSensorsclass.sensors=Sensors(logging_error=False)Getting Values from DHT SensorTo get values from the DHT sensor, use theget_dhtmethod, passing the sensor type (_type) and the GPIO pin number (gpio).sensors.get_dht(_type=22,gpio=4)# _type=22 - DHT22# _type=11 - DHT11# gpio - GPIO pin# return data (dict)# {"humidity": 36.0, "temperature": 21.0}Getting Values from ADS SensorTo get values from the ADS sensor, use theget_adsmethod, passing the channel you want to get the voltage from (channel), whether to get the normal value using interpolation (interpolate), and the minimum and maximum values at 0V (interpolate_minandinterpolate_max).sensors.get_ads(channel,interpolate=False,interpolate_min=0,interpolate_max=0)# channel - the channel that you want to get the voltage from# interpolate - getting the normal value using interpolation# interpolate_min (use if interpolate True) - minimum value at 0 V# interpolate_max (use if interpolate True) - maximum value at 0 V# return data (float)# if interpolate=False - voltage# if interpolate=True - the voltage value to which the interpolation formula is appliedGetting Values from MH-Z19 SensorTo get values from the MH-Z19 sensor, use theget_mhzmethod, passing the GPIO pin number (gpio) and whether to read using PWM (pwm).sensors.get_mhz(gpio=12,pwm=False)# gpio - GPIO pin# pwm - if pwm is True it will be read using pwm otherwise it is default# return data (dict)# {"co2": 5000}
Package: raspi
This module provides some helper functions to use with the Raspberry Pi and the RPi.GPIO.DescriptionDescriptionThis module provides some helper functions to use with the Raspberry Pi and the RPi.GPIO.When I can I will add more.If anyone wishes to contribute with new code or corrections/suggestions, feel free.InstallationInstallation$pipinstallraspiResources and contributingResourcesRepositoryContributingFork therepositoryon GitHub.Make a branch of master and commit your changes to it.Ensure that your name is added to the end of the AUTHORS.rst file using the format:Name <email@domain.com>Submit a Pull Request to the master branch on GitHub.Copyright 2009-2015 Joao Carlos Roseta Matos. Licensed under the GNU General Public License v2 or later (GPLv2+).
Package: raspi-components
raspi_componentsA python package for using certain components on the raspberry pi.These components include:ButtonsLEDsRGB LEDsActive BuzzersPCF8591PotentiometersPhotoresistorsThermistorsJoysticksYou can download the stable release of this package by runningpip install raspi-componentsYou can view the documentationhere.You can visit the source codehere.You can visit the stable package on PyPIhere.
This code is based off ofFreenove's RFID Starter Kit for Raspberry Pi
Package: raspicontrol
Polls is a simple Django app to conduct Web-based polls. For each
question, visitors can choose between a fixed number of answers.Detailed documentation is in the “docs” directory.Quick startAdd “polls” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'rest_framework',
    'raspicontrol'
]Include the polls URLconf in your project urls.py like this:url(r'^', include('raspicontrol.urls')),Runpython manage.py migrateto create the polls models.Start the development server and visithttp://127.0.0.1:8000/to check the server is running.
Package: raspi_door
Warning2014/09/24: this project is not fully functional yet – come back in
a month or so.ImportantIN CASE YOU MISSED THE “WARNING”, THIS PROJECT IS CURRENTLY
“PRE-ALPHA”, WHICH MEANS IT DOES NOT WORK YET.Theraspi-doorproject comprises the GUI that is run on the
Raspberry PI on the inside of the door so that you can control your
door withawesomeness… or, as close as I can get it there.ObjectivesHere are the list of raspi-door features that are implemented, going
to be implemented, and may be implemented.Current FeaturesExterior door bell button and sound supportInterior motion sensor and screen auto-on/off supportCurrent time displayCurrent weather displayUpcoming FeaturesDoor lock/unlock controlBluetooth & WiFi connectivity access controlActivity loggingDoor-event calendar integrationSubway service alerts & ETAsPotential FeaturesExterior camera with infrared lightingBiometrics: face/voice/fingerprint/etc recognitionNFC/RFID supportRemote door lock/unlock with camera feedNefarious activity detector! YA MAN!Raspi-Door HardwareTODO.Raspi-Door Software# (all commands as root *or* preceded with "sudo " *or* you
#  know what you are doing... :-)# (optional) create a virtualenv for raspi-door$virtualenv--prompt'(raspi-door) '/path/to/virtualenv$./path/to/virtualenv/bin/activate# install pre-requisite pygame
#   => not needed once issue #59 has been fixed:
#     https://bitbucket.org/pygame/pygame/issues/59/pygame-and-pip
# TODO: figure out why this is necessary...$wgethttp://www.pygame.org/ftp/pygame-1.9.1release.tar.gz# IFF pygame disappears, there is a cache here:$wgethttps://github.com/metagriffin/raspi-door/raw/master/cache/pygame-1.9.1release.tar.gz$sudoapt-getinstalllibsdl1.2-devlibsdl-image1.2-dev\libsdl-mixer1.2-devlibsdl-ttf2.0-dev\libsmpeg-devlibportmidi-dev$ln-s../libv4l1-videodev.h/usr/include/linux/videodev.h$easy_installpygame-1.9.1release.tar.gz# install pre-requisite pgu
# TODO: figure out why this is necessary...$wgethttps://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pgu/pgu-0.18.zip# IFF pgu disappears, there is a cache here:$wgethttps://github.com/metagriffin/raspi-door/raw/master/cache/pgu-0.18.zip$easy_installpgu-0.18.zip$pipinstallraspi-door# configure raspi-door$raspi-door--initialize>/etc/raspi-door.conf$nano/etc/raspi-door.conf# review all of the configuration options... and open a# raspi-door issue if anything is "unclear" :-)Troubleshooting"ImportError: No module named pkg_resources"If you run into an issue during the install process and pip just
doesn’t work anymore, you may need to re-install
setuptools. However, you need to do this without usingpiporeasy_install… so, checkhttps://pypi.python.org/pypi/setuptoolsfor direct installation details, i.e.:$wgethttps://bootstrap.pypa.io/ez_setup.py-O-|pythonCreditsyuv2rgb: Phil Burgess / Paint Your Dragon for Adafruit Industriespicamera: Dave Hughes
Package: raspigaragealert
Currently incredibly alpha code, but I wanted to make sure I could publish starting early.Generate an alert when your garage door is left openI was inspired by the work done by this guy:https://github.com/rllynch/pi_garage_alert, but I wanted to make pretty drastic changes and I thought it would be rude to so radically change someone’s code in a fork.The exact magnetic sensor he used was unavailable, so I bought a similar model, SM-226L-3Q. (https://www.amazon.com/gp/product/B005H3GCW0).On that model, if you connect it with the red wire, it goes high (1) if the garage is closed and low (0) if open.
Package: raspihive
InstallInstall from pypi:pip install raspihiveInstall from source:Setupif you want to run RaspiHive on Raspberry Pi OS, you need the 64 Bit version (wich is Beta at the moment).download the Image from:Raspberry Pi 64 Bit Beta OSand use the Raspberry Pi imager to write it on a SD Card:Raspberry Pi DownloadsTested on Ubuntu 18.04.Install SetupTools:$ sudo apt-get install python3-setuptoolsClone this repo:$ git clone https://github.com/raspihive/raspihive.gitInstallraspihivePython3 module:$ cd raspihive
$ sudo python3 setup.py installDevelopmentIf you are interested in contributing, please go through ourCONTRIBUTINGguidelines first.SetupEnvironmentSetup virtualenv:python3 -m venv venvActivate venv:source venv/bin/activateDependenciespip3 install -r requirements/dev.txtRunpython3 -m raspihiveWorks on:Ubuntu 18.04Ubuntu 20.04Fedora 33LinuxMint 20Development screenshots:
Package: raspi-logger
Raspberry PiDeveloped for a Pi Zero W, but should work on the others as well. Just make
sure any kind of internet connectivity is available.Install instructionsInstall via pip, but be sure to use the 3 version.pip3installraspi_loggerThe other possibility is to clone the repo to/home/pi/and run inside the repo:python3setup.pydevelopI used a Raspian image for development.to describe:enable SSHenable WiFienable W1(depending on kernel version, use GPIO4 and GPIO17 for W1)Enable one wire on startupThe scriptraspi_logger/enable_w1.shenables W1 on GPIO 4 and 17.
Run the script with root privileges on each startup.
Do that either by hand like:sudochmod755raspi_logger/enable_w1.sh
sudocrontab-eAnd then in the file add the line:@rebootpath/to/raspi-logger/raspi_logger/enable_w1.shThe CLI of the module can activate the cronjob using the correct paths for you as well.
But you need to run python withsudothen and need to install the package for root user
as well.
Then:sudopython3-mraspi_loggerenable_w1
Package: raspi.lpd8806
raspi.lpd8806This package provides helpers to easily build fancy LED stuff with a “lpd8806
based digital addressable RGB led strip”:https://www.adafruit.com/products/306.It consists of three parts.API for sequencesTo define a sequence you can useraspi.lpd8806.led_lib.Sequenceas a base
class.On the class you can set, if the sequence should loop by settingloop =
True.You also have to define the used leds by the sequence on the class in a listleds = [12, 33, 44].The actual sequence is defined in the __call__ method which has to
return a generator yielding leds with their values for each frame.You can set a single Led viaraspi.lpd8806.led_lib.Led(index).on(red, green,
blue), or set multiple Leds at once viaLeds([12, 33, 44]).on({12: (r, g, b),
33: (r, g, b), 44: (r, g, b)}).There is also a convenience method to set a predefined part of your strip by
usingraspi.lpd8806.led_lib.Strip(‘strip_name’).on(r, g, b).Led, Leds and Strip instances of course also haveoff()methods to set all
colors to 0.WebserverThe Webserver serves a page with buttons to start or stop the sequences.
It is started with the led_webserver script. See –help for details.Queue WorkerThe Queue worker processes the commands of the webserver and communicates with
the LED strip. It can be started with the led_queue_worker script. See –help
for details.CHANGES0.2 (2013-08-16)Move the README to its proper place.0.1 (2013-08-16)Initial public release.Download
Package: raspi-music-button
Raspi-Music-ButtonRaspi-Music-Button is a small python based package that interacts with linux packages on the Raspberry Pi to play music.
Moreover it can be used to trigger music by a button connect to one of the Raspberry Pi
gpio.RequirementsThe following linux packages need to be installed on the opreation system:aplayamixermpg321Installation$ pip install -U raspi-music-buttonQuick StartThe package is available under the commandraspi-music. The command line help can be called withraspi-music --helpTo play just a simple song runraspi-music play song my-song.mp3To play a whole folder filled with mp3 runraspi-music play folder /my/folderUse the following commands to do the same but start playing only when the button is triggered.raspi-music button song my-song.mp3

raspi-music button folder /my/folderLicenseThis project is licensed under the MIT License (see theLICENSEfile for
details).
Package: raspi-poe-mon
Raspi PoE HAT MonitorA controller for the display and fan of the Raspberry Pi Power Over Ethernet HAT (Type B), compatible with Raspberry Pi 3B+/4B.The PoE HAT (Waveshare SKU 18014) allows you to deliver gigabit ethernet connectivity and power supply to your Raspi using a single connection (if you have a PoE capable switch/router). While PoE works without additional drivers, there is also a fan and a 128x32 pixel monochrome display on the HAT, both of which can be controlled with this software.Featuresautomatic fan control to reach your desired temperature targetshow status information on the display: IP address, CPU usage, CPU temperature, RAM usage, disk usage.manual fan control via CLIshow custom text via CLI (wip)Getting StartedThe OLED display and fan controls of the PoE HAT are accessed through the I2C interface, which on Raspberry Pi OS is deactivated by default. To activate it, runsudo raspi-configand selectInterface Options->I2C->Yes. You need to reboot your Raspi to apply the change.Next we install required packages: Python and pip are needed; the remaining packages are dependencies of the Pillow graphics library.sudo apt install python3 python3-pip libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 libtiff5 libsdl2-image-2.0-0Now we are ready to installraspi-poe-monfrom PyPI:pip install raspi-poe-monYou can now runraspi-poe-monon your terminal to activate the display. Callraspi-poe-mon --helpto get usage instructions.User Guidetbdraspi-poe-mon --helpDevelopmentTo set up your local development environment, please make sure thatpoetryis installed and updated. Then clone this repo and install the package withpoetry installThis will create a new virtualenv in the.venvfolder, install all dependencies and then theraspi-poe-monpackage. You should now be able to access the CLI withpoetry run raspi-poe-mon.We usepytestas test framework:poetry run pytestTo build a distribution package (wheel), please usepoetry buildBefore contributing code, please set up the pre-commit hooks to reduce errors and ensure consistencypre-commit installTips & TricksYou canincrease the I2C baudratefrom the default 100KHz to 400KHz by addingdtparam=i2c_arm=on,i2c_baudrate=400000to/boot/config.txtand then rebooting. This will allow you to run animations at a higher framerate, but it is not required for the default status display.If you try to install Python packages via pip on Raspberry Pi OS, you may get stuck due toissues with gnome-keyring. If this is the case, pleaseexport PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyringand try again. You may want to add this to your.profileif the issue persists.LinksWaveshare: PoE HAT (B)luma.oledpillow (PIL) dependenciesIncrease I2C baudrate from the default of 100KHz to 400KHzFont: CG pixel 4x5LicenseThis project is available under the terms of theMIT License.
Package: raspiSensors
Raspberry Pi SensorsThis is a Python 3 package that enables Raspberry Pi to read various sensors .It has been tested on Python 3.5/Raspbian (stretch).
Supported devices include:HCSR04 ultrasonic sensorPCA9685 Adafruit 16-channel 12 Bit PWM DriverBMP280 BarometerTriple Axis Magnetometer QMC5883LAS3935 lightning sensor MOD-1016 embedded adventuresREQUIREMENTSadafruit-circuitpython-servokitInstallationFrom source  (incl. examples, fritzing and ebooks)gitclonehttps://github.com/hanshof/rpiSensors.gitcdrpiSensorspythoninstallsetup.pyPIPpipinstallraspiSensorsHCSR04 ultrasonic sensorThis is the HC-SR04 ultrasonic distance sensor.
This economical sensor provides 2cm to 400cm
of non-contact measurement functionality with a ranging accuracy
that can reach up to 3mm.
Each HC-SR04 module includes an ultrasonic transmitter
, a receiver and a control circuit.There are only four pins that you need to worry about on the HC-SR04:
VCC (Power), Trig (Trigger), Echo (Receive), and GND (Ground).
You will find this sensor very easy to set up and use for your next range-finding project!Example:fromraspiSensorsimporthcsr04asHCSR04ultrasonic=HCSR04(trigger_pin=21,echo_pin=20)print(ultrasonic.distance())returnsdistanceincmPCA9685 Adafruit 16-channel 12 Bit PWM DriverUsing only two pins, control 16 free-running PWM outputs!
You can even chain up 62 breakouts to control up to 992 PWM outputs (which we would really like to see since it would be glorious)
It's an i2c-controlled PWM driver with a built in clock. That means that, unlike the TLC5940 family, you do not need to continuously send it signal tying up your microcontroller, its completely free running!
It is 5V compliant, which means you can control it from a 3.3V microcontroller and still safely drive up to 6V outputs (this is good for when you want to control white or blue LEDs with 3.4+ forward voltages)
6 address select pins so you can wire up to 62 of these on a single i2c bus, a total of 992 outputs - that's a lot of servos or LEDs
Adjustable frequency PWM up to about 1.6 KHz
12-bit resolution for each output - for servos, that means about 4us resolution at 60Hz update rate
Configurable push-pull or open-drain output
Output enable pin to quickly disable all the outputsExample:fromraspiSensorsimportpca9685asPCA9685servos=PCA9685(channels=16)servos.kit.servo[0].angle=90BMP280 BarometerThis is a Barometer Pressure Sensor module
It could measure the pressure and temperature.
This program depend on BMP280.py writted by Adafruit.ExampleDatasheetEbookFritzingTriple Axis Magnetometer QMC5883LMagnetometer QMC5883L is used for measuring the direction and magnitude of the Earth’s magnetic field. It is used for low cost compassing and magnetometry.
It measures the Earth’s magnetic field value along the X, Y and Z axes from milli-gauss to 8 gauss.
It can be used to find the direction of heading of the device.
It uses I2C protocol for communication with microcontroller.ExampleAS3935 lightning sensor MOD-1016 embedded adventuresThe MOD1016 is a lightning sensor based on the AMS3935. It allows you to detect
storms up to 40km away.ExampleDatasheet MOD-1016Datasheet AS3935EbookFritzing
Package: raspisump
Raspi-sump is a sump pit water level monitoring system that uses a Raspberry Pi and an Ultrasonic Sensor (HC-SR04).Currently the system monitors the water level in your pit at defined intervals. It sends
email sms alerts if the water reaches a critical level, indicating a possible sump pump failure.What's NewVersion 1.9 -Systemdis now an option to replace crontab. Control all Raspi-Sump services and Chart creation timers withSystemd.You can continue using crontab if you prefer.See thechangelogfor the latest information on Raspi-Sump features.Supported Versions of Raspbian / Raspberry Pi OSRaspi-Sump is currently supported on Raspberry Pi OS (Bullseye) and Raspian (Buster)Plans are in the works for Raspberry Pi OS Bookworm. However changes to Python require a rethink on how Raspi-Sump is installed. More to come. For the time being, Bookworm is not supported.Discord GroupDiscuss and get support from other users. Email (alaudet@linuxnorth.org) for an invite link.Install Raspi-SumpFull install instructions are located athttps://github.com/alaudet/raspi-sump/blob/master/docs/install.mdUpgrade Raspi-SumpUpgrade an existing versionsudo pip3 install -U --no-binary :all: raspisumpIf upgrading from version 1.8 or lower to version 1.9 see the1.9 Upgrade InstructionsMore InfoFurther details provided athttps://www.linuxnorth.org/raspi-sump/DisclaimerYou are welcome to use Raspi-Sump but there is no guarantee it will work. Your house may still flood if your sump pump fails. This software comes with no warranty. See License details.This is not a replacement for a properly maintained water pumping system. It is one tool you can use to give yourself extra piece-of-mind.Best practices should include:A backup pump that triggers at a slightly higher water level than your main pump.The secondary pump should be connected to a seperate dedicated electrical breaker.You should also have a generator that can provide power should you have an extended outage during the spring or other unseasonally wet time of year.if you are building a new home, pay attention to the grade of your property, as you may be able to let gravity empty your pit for you. That would be the best approach with a backup pump for added protection.Once you have done all of these things, then consider using a monitoring system like Raspi-Sump.LicenseRaspi-Sump is released under theMIT License.ContributePlease refer to theContributing Guidelinesbefore issuing a pull request.DonateYour Donation is Appreciated