GithubHelp home page GithubHelp logo

ist-circuits's Introduction

Setup

SSH into your team’s Pi Ensure your are part of the gpio group

$ groups

If you do not see gpio in the list then run the following command

$ sudo usermod -aG gpio username

Create a directory for your project

$ mkdir circuit
$ cd circuit

Setup circuit with LED On your breadboard, create a circuit to turn on an LED using jumper wires, a resistor, and an LED Use jumper wires to hook up a second breadboard and ensure you can get your circuit working on the 2nd breadboard. Move the 5V jumper wire to one of the numbered GPIO pins, remember which pin number your circuit is using for the program below.

Modifying led.c

The line of code needed to turn on or off an LED is gpiod_line_set_value(line, val);. You will need to modify the program to include a loop that will turn the LED on and off.

You will need to wrap the above line in a for loop, and include a few other lines

for(int i = 0; i < ?; i++)

usleep(500000);

val = !val;

In the for loop, you will need to edit the middle condition so that the loop runs for as many times as you would like. The usleep function takes as it's input the number of microseconds to sleep for, so 500000 will sleep for half of a second.

ist-circuits's People

Contributors

murrymcintosh avatar

Stargazers

 avatar

Watchers

 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.