hbbd```b``"k3d>"Ys$i ?f#3+H(? I tried and tried using different spi overlays with exclusive use pins and ends up the board not booting . You can also use the name of the pin to access it, which would be . The BeagleBone Black is unique in that it has quite a few pins that are available on easy to use pin headers, as well as being a fairly powerful little system. You will be redirected back to this guide once you sign in, and can then subscribe to this guide. I found this lib. Beaglebone Black to the GPIO control over Python Flask Webserver HTML Ask Question Asked 7 years ago Modified 4 years, 10 months ago Viewed 995 times 0 Web server can not control the GPIO I wrote. Importing Adafruits BeagleBone Input Output Library: Setting a pin for PWM with 50 percent duty cycle: By entering your email address and clicking the Submit button, you agree to the Terms of Use and Privacy Policy & to receive electronic communications from Dummies.com, which may include marketing promotions, news and updates. To run balena CLI commands, open the Terminal app (. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. It waits for the end of the ADC sequence by waiting for /dev/uio5 event. to Hello balena! Setting up IO Python Library on BeagleBone Black. Beaglebone Black 2. 4-channel I2C-safe Bi-directional Logic Level Converter, "The master in the art of living makes little distinction between work and play", Setting up IO Python Library on BeagleBone Black, Adafruit 1-Wire Thermocouple Amplifier - MAX31850K, 2.3" Monochrome 128x32 OLED Display Module, 1.5" & 2.4" Monochrome 128x64 OLED Display Module. {"appState":{"pageLoadApiCallsStatus":true},"articleState":{"article":{"headers":{"creationTime":"2016-03-26T08:06:31+00:00","modifiedTime":"2016-03-26T08:06:31+00:00","timestamp":"2022-09-14T17:52:40+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"BeagleBone","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33518"},"slug":"beaglebone","categoryId":33518}],"title":"How to Control BeagleBone's GPIOs","strippedTitle":"how to control beaglebone's gpios","slug":"how-to-control-beaglebones-gpios","canonicalUrl":"","seo":{"metaDescription":"Following is a handy reference that you can use to control and access your BeagleBones general purpose input/output (GPIOs) with the file system, BoneScript, a","noIndex":0,"noFollow":0},"content":"

Following is a handy reference that you can use to control and access your BeagleBones general purpose input/output (GPIOs) with the file system, BoneScript, and Python.

\n

Controlling the GPIO with the file system

\n

You can use the following commands to control the GPIO with the file system.

\n
    \n
  • Exporting a pin:

    \n
    echo 40 > /sys/class/gpio/export
    \n
  • \n
  • Setting a pin OUTPUT:

    \n
    echo out > /sys/class/gpio/gpio40/direction
    \n
  • \n
  • Writing a pin HIGH:

    \n
    echo 1 > /sys/class/gpio/gpio40/value
    \n
  • \n
  • Writing a pin LOW:

    \n
    echo 0 > /sys/class/gpio/gpio40/value
    \n
  • \n
  • Setting a pin INPUT:

    \n
    echo in > /sys/class/gpio/gpio40/direction
    \n
  • \n
  • Reading the value from an INPUT pin (returns 1 for HIGH and 0 for LOW):

    \n
  • \n
  • cat /sys/class/gpio/gpio40/value
    \n
  • \n
\n

Controlling the GPIO with BoneScript

\n

You can use the following BoneScript commands to control the GPIO.

\n
    \n
  • Loading a BoneScript module:

    \n
    var b = require('bonescript');
    \n
  • \n
  • Setting a pin OUTPUT:

    \n
    b.pinMode(\"P9_14\", b.OUTPUT);
    \n
  • \n
  • Writing a pin HIGH:

    \n
    b.digitalWrite(\"P9_14\", b.HIGH);
    \n
  • \n
  • Writing a pin LOW:

    \n
    b.digitalWrite(\"P9_14\", b.LOW);
    \n
  • \n
  • Setting a pin INPUT:

    \n
    b.pinMode(\"P8_11\", b.INPUT);
    \n
  • \n
  • Reading the value from a digital INPUT pin (returns HIGH or LOW):

    \n
    b.digitalRead(\"P8_11\");
    \n
  • \n
  • Setting a pin for pulse-width modulation (PWM) with 50 percent duty cycle:

    \n
    b.pinMode('P9_14', b.OUTPUT);\nb.analogWrite('P9_14', 0.5);
    \n
  • \n
  • Reading the value from an analog INPUT pin (returns a value between 0 and 1):

    \n
  • \n
  • b.analogRead('P9_40');
    \n
  • \n
\n

Controlling the GPIO with Python

\n

You can use the following Python commands to control the GPIO.

\n
    \n
  • Importing Adafruits BeagleBone Input Output Library:

    \n
    import Adafruit_BBIO.GPIO as GPIO
    \n
  • \n
  • Setting a pin OUTPUT:

    \n
    GPIO.setup(\"P9_14\", GPIO.OUT)
    \n
  • \n
  • Writing a pin HIGH:

    \n
    GPIO.output(\"P9_14\", GPIO.HIGH)
    \n
  • \n
  • Writing a pin LOW:

    \n
    GPIO.output(\"P9_14\", GPIO.LOW)
    \n
  • \n
  • Setting a pin INPUT:

    \n
    GPIO.setup(\"P8_11\", GPIO.IN)
    \n
  • \n
  • Reading the value from a digital INPUT pin (returns HIGH or LOW):

    \n
    GPIO.input(\"P8_11\")
    \n
  • \n
  • Setting a pin for PWM with 50 percent duty cycle:

    \n
    import Adafruit_BBIO.PWM as PWM\nPWM.start(\"P9_14\", 50)
    \n
  • \n
  • Setting an analog INPUT:

    \n
    import Adafruit_BBIO.ADC as ADC\nADC.setup()
    \n
  • \n
  • Reading the value from an analog INPUT pin (returns a value between 0 and 1):

    \n
  • \n
  • analogReading = ADC.read(\"P9_40\")
    \n
  • \n
","description":"

Following is a handy reference that you can use to control and access your BeagleBones general purpose input/output (GPIOs) with the file system, BoneScript, and Python.

\n

Controlling the GPIO with the file system

\n

You can use the following commands to control the GPIO with the file system.

\n
    \n
  • Exporting a pin:

    \n
    echo 40 > /sys/class/gpio/export
    \n
  • \n
  • Setting a pin OUTPUT:

    \n
    echo out > /sys/class/gpio/gpio40/direction
    \n
  • \n
  • Writing a pin HIGH:

    \n
    echo 1 > /sys/class/gpio/gpio40/value
    \n
  • \n
  • Writing a pin LOW:

    \n
    echo 0 > /sys/class/gpio/gpio40/value
    \n
  • \n
  • Setting a pin INPUT:

    \n
    echo in > /sys/class/gpio/gpio40/direction
    \n
  • \n
  • Reading the value from an INPUT pin (returns 1 for HIGH and 0 for LOW):

    \n
  • \n
  • cat /sys/class/gpio/gpio40/value
    \n
  • \n
\n

Controlling the GPIO with BoneScript

\n

You can use the following BoneScript commands to control the GPIO.

\n
    \n
  • Loading a BoneScript module:

    \n
    var b = require('bonescript');
    \n
  • \n
  • Setting a pin OUTPUT:

    \n
    b.pinMode(\"P9_14\", b.OUTPUT);
    \n
  • \n
  • Writing a pin HIGH:

    \n
    b.digitalWrite(\"P9_14\", b.HIGH);
    \n
  • \n
  • Writing a pin LOW:

    \n
    b.digitalWrite(\"P9_14\", b.LOW);
    \n
  • \n
  • Setting a pin INPUT:

    \n
    b.pinMode(\"P8_11\", b.INPUT);
    \n
  • \n
  • Reading the value from a digital INPUT pin (returns HIGH or LOW):

    \n
    b.digitalRead(\"P8_11\");
    \n
  • \n
  • Setting a pin for pulse-width modulation (PWM) with 50 percent duty cycle:

    \n
    b.pinMode('P9_14', b.OUTPUT);\nb.analogWrite('P9_14', 0.5);
    \n
  • \n
  • Reading the value from an analog INPUT pin (returns a value between 0 and 1):

    \n
  • \n
  • b.analogRead('P9_40');
    \n
  • \n
\n

Controlling the GPIO with Python

\n

You can use the following Python commands to control the GPIO.

\n
    \n
  • Importing Adafruits BeagleBone Input Output Library:

    \n
    import Adafruit_BBIO.GPIO as GPIO
    \n
  • \n
  • Setting a pin OUTPUT:

    \n
    GPIO.setup(\"P9_14\", GPIO.OUT)
    \n
  • \n
  • Writing a pin HIGH:

    \n
    GPIO.output(\"P9_14\", GPIO.HIGH)
    \n
  • \n
  • Writing a pin LOW:

    \n
    GPIO.output(\"P9_14\", GPIO.LOW)
    \n
  • \n
  • Setting a pin INPUT:

    \n
    GPIO.setup(\"P8_11\", GPIO.IN)
    \n
  • \n
  • Reading the value from a digital INPUT pin (returns HIGH or LOW):

    \n
    GPIO.input(\"P8_11\")
    \n
  • \n
  • Setting a pin for PWM with 50 percent duty cycle:

    \n
    import Adafruit_BBIO.PWM as PWM\nPWM.start(\"P9_14\", 50)
    \n
  • \n
  • Setting an analog INPUT:

    \n
    import Adafruit_BBIO.ADC as ADC\nADC.setup()
    \n
  • \n
  • Reading the value from an analog INPUT pin (returns a value between 0 and 1):

    \n
  • \n
  • analogReading = ADC.read(\"P9_40\")
    \n
  • \n
","blurb":"","authors":[{"authorId":9270,"name":"Rui Santos","slug":"rui-santos","description":"","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9270"}},{"authorId":9271,"name":"Luis Miguel Costa Perestrelo","slug":"luis-miguel-costa-perestrelo","description":"","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9271"}}],"primaryCategoryTaxonomy":{"categoryId":33518,"title":"BeagleBone","slug":"beaglebone","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33518"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[{"label":"Controlling the GPIO with the file system","target":"#tab1"},{"label":"Controlling the GPIO with BoneScript","target":"#tab2"},{"label":"Controlling the GPIO with Python","target":"#tab3"}],"relatedArticles":{"fromBook":[],"fromCategory":[{"articleId":207579,"title":"BeagleBone For Dummies Cheat Sheet","slug":"beaglebone-for-dummies-cheat-sheet","categoryList":["technology","computers","hardware","beaglebone"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207579"}},{"articleId":203333,"title":"7 Capes You Can Add to the BeagleBone","slug":"7-capes-you-can-add-to-the-beaglebone","categoryList":["technology","computers","hardware","beaglebone"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203333"}},{"articleId":203332,"title":"4 Amazing Projects for the BeagleBone","slug":"4-amazing-projects-for-the-beaglebone","categoryList":["technology","computers","hardware","beaglebone"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203332"}},{"articleId":145670,"title":"Comparing BeagleBone Black and Raspberry Pi","slug":"comparing-beaglebone-black-and-raspberry-pi","categoryList":["technology","computers","hardware","beaglebone"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/145670"}},{"articleId":144981,"title":"How to Connect the BeagleBone Black via Serial over USB","slug":"how-to-connect-the-beaglebone-black-via-serial-over-usb","categoryList":["technology","computers","hardware","beaglebone"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/144981"}}]},"hasRelatedBookFromSearch":true,"relatedBook":{"bookId":292900,"slug":"arduino-projects-for-dummies","isbn":"9781118551479","categoryList":["technology","computers","hardware","arduino"],"amazon":{"default":"https://www.amazon.com/gp/product/1118551478/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1118551478/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1118551478-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1118551478/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1118551478/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://catalogimages.wiley.com/images/db/jimages/9781118551479.jpg","width":250,"height":350},"title":"Arduino Projects For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"\n

Brock Craft is a Lecturer in Physical Computing at Goldsmiths, University of London in the Department of Computing. When the download completes, you should have a zipped image file with a name like balena-First-Fleet-beaglebone-black-2.80.3+rev1-v12.7.0.img.zip. "), you can click on the "GateOne SSH link to the upper left, in the sidebar. Take a note of the FLEET NAME as you'll need this in the next step to push the code to your device(s) in that fleet. Please sign in to subscribe to this guide. endstream endobj 887 0 obj <>/Metadata 30 0 R/Pages 884 0 R/StructTreeRoot 58 0 R/Type/Catalog>> endobj 888 0 obj <>/MediaBox[0 0 595.32 841.92]/Parent 884 0 R/Resources<>/Font<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Rotate 0/StructParents 0/Tabs/S/Type/Page>> endobj 889 0 obj <>stream Enter a fleet name, select the BeagleBone Black device type, choose the Starter fleet type, and click Create new fleet: You'll then be redirected to the summary of the newly created fleet, where you can add your first BeagleBone Black. Making statements based on opinion; back them up with references or personal experience. You can use the following Python commands to control the GPIO. To create your first fleet, log into your balenaCloud dashboard and click the Create fleet button. Remove and re-connect power to the BeagleBone Black to boot the device. hb```` B,@CZ\O3t800u``l5vn% @.' The Adafruit_I2C.py module is now included in the Adafruit_BBIO library as a top-level module. This page (Overview) was last updated on Jun 12, 2013. First, you setup your event to watch for, then you can do whatever else your program will do, and later on, you can check if that event was detected. Which will keep it constantly on but I have a feeling its actually blinking to fast for me to see. Using library for SPI Setup Beaglebone Black The first step is setup the Beaglebone Black if you have one in your hand. You will be redirected back to this guide once you sign in, and can then subscribe to this guide. Find out more about the differences between Development and Production images. Please update your code accordingly. First-Fleet with the name of your fleet. When reporting issues, plesae run the following script which will print the system configuration: This script should be present for any Debian or Ubunut image downloaded from: P8_14 is digital output, not analog. This guide was first published on Jun 13, 2013. https://github.com/derekmolloy/exploringBB, https://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/ChaExamples.html. Not the answer you're looking for? https://beagleboard.org/p/projects/tags/python, PyGame examples on elinux.org Your device type will be preselected here since you already chose it when creating the fleet. vU' 5VPePh IP9^9dx#iWi[. For security reasons, an e-mail has been sent to you acknowledging your subscription. Triac diode for example - the simplest. It was last This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. You can access the channels by either referencing the pin "key" or the name. Unexpected uint64 behaviour 0xFFFF'FFFF'FFFF'FFFF - 1 = 0? In this guide, we will help you get started with balenaCloud by: Once you've completed this getting started guide to balena, you'll be equipped with the fundamentals needed to continue developing your application using balenaCloud and be on the path to deploying fleets of devices to production. For security reasons, an e-mail has been sent to you acknowledging your subscription. Follow the instructions below to install balenaCLI for the operating system available on your system. Activate local mode on the device via the dashboard. You must connect to that pin some trigger logic if u want to do that. We will use the balena CLI for this. The same build process as before is carried out, but this time instead of using the balena builders, the build takes place locally on the device itself.