# Raspberry Pi GPIO Demo

#### *rasp.MOHIT-sketch*

### Description:

This Skill demonstrates how to interact with the Raspberry Pi GPIO pins using a Mycroft Skill. This Skill shows both reading data from a GPIO port (detecting a button press) and writing data to the port (illuminating an LED).

#### Preparation

[You will need to first install the GPIO libraries for Picroft, and add some additional permissions](https://mycroft.ai/documentation/picroft/#using-the-gpio-pins-on-the-raspberry-pi-3).

#### Generation

The documentation is done using Sphinx, which picks up comments from the code. The following will generate the html docs.

`make docs`

You can then find the generated html in `docs/build/html/index.html`. Open that file in your browser and you should be able to navigate to the docs.

#### Installing from the `makefile`

* Change the Makefile IP address for the RPi installation to the IP address of your RPi.

That is, edit the file `makefile` using your favorite editor like `nano` or `vi`.

The line you will need to change is `scp -r * pi@192.168.205.115:/opt/mycroft/skills/skill-gpio`.

Change this to have the IP address of your RPi.

* Create the folder `/opt/mycroft/skills/skill-gpio` on the RPi for the installer.

You can do this by using the command `mkdir /opt/mycroft/skills/skill-gpio`

* Build the code using the `makefile`. `make install.pi`

#### Testing the `makefile`

`make test.pi`

This will run a test to be sure you have access to the GPIO and will report any errors that are identified.

#### Notes

If the LED blinking is too fast, it will be difficult to get a command to execute because there will be a voice response when the the LED turns off and on. Turn the blinking to a lower frequency to be able to execute commands.

#### Circuit

Please use the below image as a guide to the circuit layout:

![](https://github.com/MycroftAI/picroft_example_skill_gpio/blob/master/IMG_20170706_153744.jpg)

#### Platform:

![Mark I](https://500835181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzX1y2oL49APvqHoV5o%2Fuploads%2Fgit-blob-20518efa3a75671db56c323c5962b4108102367b%2Fmark-1-icon.png?alt=media) ![Picroft](https://500835181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzX1y2oL49APvqHoV5o%2Fuploads%2Fgit-blob-b7dc7493983981386b73158927c1ddf91597de7a%2Fpicroft-icon.png?alt=media)

#### Examples:

> Turn LED on.\
> Turn LED off.\
> Blink LED.\
> LED status.

### Installation:

{% hint style="warning" %}
This skill is not aproved by Mycroft skill tester.
{% endhint %}

{% tabs %}
{% tab title="Install by mycroft-msm" %}
`mycroft-msm install https://github.com/MOHIT-sketch/rasp`
{% endtab %}
{% endtabs %}

### Summary:

**Github:** <https://github.com/MOHIT-sketch/rasp>\
**Owner:** [@MOHIT-sketch](https://github.com/MOHIT-sketch)\
**Created:** 2019 Aug 05 09:10:55 UTC **Last updated:** 2019 Aug 05 09:21:02 UTC\
**License:** Apache License 2.0

**Categories:** \[ IoT ]\
**Tags:** #IoT #GPIO #RPi


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://andlo.gitbook.io/mycroft-skills-list/skills/not-in-market/iot/rasp.mohit-sketch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
