WORKSHOP LED CONTROL.

Slides:



Advertisements
Similar presentations
Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: The Basics.
Advertisements

Interfacing Project. Computer Controlled Car Left Headlight – D0 Right Headlight – D1 Left Taillight – D2 Right Taillight – D3.
Agenda Web Application Web Page development WAMP
V Avon High School Tech Club Agenda Old Business –Executive Committee –LCCUG meeting volunteer(s) –Reward Points Program New Business –Weekly.
CSC 405 Lab 1 - Building a Simple Combinatorial Circuit In this laboratory exercise you will learn about the layout of some small-scale integrated circuits.
MICROCONTROLLERS MODULE 2 Programming, Controlling and Monitoring.
Using the Board of Education Breadboard and Your Multimeter ENGR 120 Work in teams of two!
1 Boe-Bot Parts BOE-BOT Lecture #1b DE - Digital Electronics.
Living with the Lab Using Your Arduino, Breadboard and Multimeter EAS 199A Fall 2011 Work in teams of two!
Embedded Programming and Robotics Lesson 1 Basic Electricity and Electronics Transistor Basics Lesson 1 -- Basic Electricity1.
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
1 Basic Electronics Voltage (V or E): Potential difference between 2 points. Volts. (+) - A lack of electrons (-) – A surplus of electrons When a circuit.
Practice Problems to become familiar with circuits and circuit diagrams.
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
Experiments Day 1 & 2 Resistors, Potentiometers and Photocells.
Computational Boot Camp HTML Mike Schaffer. 8/23/2002 (MES) HTML What is HTML? HTML stands for HyperText Markup Language HTML is the language for publishing.
Chapter 3 Creating Dynamic Web Sites Part 1. Large Sites ”complex sites demand compartmentalization of some HTML or PHP code”.
PHP “Personal Home Page Hypertext Pre-processor” (a recursive acronym) Allows you to create dynamic web pages and link web pages to a database.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Basic Stamp OEM module By Wilmer Arellano. 2  The BASIC Stamp 2 OEM is a discreet component version of the BS2 which may be purchased in kit form. 
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
Welcome to Week 4 at the Summer Computer Club Raspberry Pi (contd)
Chap 2 – Getting Started COMP YL Professor Mattos.
Basic Stamp OEM module By Wilmer Arellano. 2  The BASIC Stamp 2 OEM is a discreet component version of the BS2 which may be purchased in kit form. 
Raspberry Pi Project Control Your Home Lights with a Raspberry Pi.
Praxis I 13 Oct Outline Component & Device Measurement and Instrument Datasheet How to build circuit using breadboard.
Building Your Own Website Using:. Install & configure LAMP. Download WordPress and run it as a local website on your Raspberry Pi. Configure WordPress.
Controlling an LED with a switch. 2 breadboard place where you can build electric circuits really quickly the magical breadboard.
Embedded Software Design Week III Processor Basics Raspberry Pi -> Blinking LEDs & pushing buttons.
PHP Basics and Syntax Lesson 3 ITBS2203 E-Commerce for IT.
Building Circuits.
PHP Assignment Help BookMyEssay. What is PHP PHP is a scripting language generally used on web servers. It is an open source language and embedded code.
Build on a Breadboard Simulator
Class 1: Building a Raspberry Pi LED Flasher
Arduino Uno – controlling LED strips
CGI programming Using Apache.
Light Dependent Resistor
Introduction to HTML Section A – Programming, HTML
Introduction to Dynamic Web Programming
Running your own web server
Arduino Development for Beginners
RASPBERRY PI WORKSHOP.
Building Raspberry Pi Controllers with Python
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
Web UI Basics ITM 352.
Session 3 DIY Moderate Project
Introduction to Arduino Microcontrollers
BASIC PHP and MYSQL Edward S. Flores.
Lighting LEDs with a RASPBERRY PI
Intro to PHP & Variables
Electronic Education Kits
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
Internet-of-Things (IoT)
Raspberry Pi: External Inputs & Outputs
Module 1 Introduction to PHP 11/30/2018 CS346 PHP.
Basic Electronics Part Two: Electronic Components.
CGI programming Using Apache.
Basic circuits Electrical circuits Electrical properties Ohm’s law
Raspberry Pi 2/3 GPIO - LED, Button
Arduino Part 4 Let there be more light.
RPi 2/3 GPIO + Web(Flask)
How an NPN Transistor Works
Light Dependent Resistor
Passive Infrared Sensor
testing and experimenting with electronic circuits
Intro to Arduino Part 2 The Breadboard
Objective of the lesson
I/O Experiments Assignment 1.
2019 Investing Now Summer Program
Robot and Crickit HAT © Copyright 2019 by Dr. Elizabeth I. Horvath and Dr. Eva A. Horvath 1.
Presentation transcript:

WORKSHOP LED CONTROL

Things you need 1 Breadboard 5 LED 5 220 ohm resistor Male-Female & Male-to-Male Jumper wires

LED LED stands for Light Emitting Diode, and glows when electricity is passed through it. RESISTOR   You must ALWAYS use resistors to connect LEDs up to the GPIO pins of the Raspberry Pi. The Raspberry Pi can only supply a small current (about 60mA). The LEDs will want to draw more, and if allowed to they will burn out the Raspberry Pi.

WIRE FEMALE-TO-MALE: MALE-TO-MALE: Jumper wires are used on breadboards to ‘jump’ from one connection to another. The ones you will be using in this circuit have different connectors on each end. FEMALE-TO-MALE: MALE-TO-MALE:

BREADBOARD The breadboard is a way of connecting electronic components to each other without having to solder them together.

Building the Circuit Use one of the jumper wires to connect a ground pin to the rail, marked with blue, on the breadboard. The female end goes on the Pi's pin, and the male end goes into a hole on the breadboard. Then connect the resistor from the same row on the breadboard to a column on the breadboard, as shown in the right. Next, push the LEDs legs into the breadboard, with the long leg (with the kink) on the right. Lastly, complete the circuit by connecting pin 18 to the right hand leg of the LED. This is shown here with the orange wire.

The Code sudo nano LED.py Type in the following code: import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(18,GPIO.OUT) while True: print "LED on" GPIO.output(18,GPIO.HIGH) time.sleep(1) print "LED off" GPIO.output(18,GPIO.LOW) time.sleep(1) Once you have typed all the code and checked it, save and exit the text editor with “Ctrl + x” then “y” then “enter”. Running the Code To run this code type: sudo python LED.py You will see the LED turn on for a second and then turn off. If your code does not run and an error is reported, edit the code again using sudo nano LED.py.

Controlling LED via Localhost First install Apache HTTP server and its PHP extension by: sudo apt-get install apache2 php5 libapache2-mod-php5 Navigate to the browser and type your Pi's IP address. You will see an “It Works” page. Now we should test whether its PHP extension is working.  To test, go to /var/www/html directory (cd /var/www/html) then delete the filename index.html and create a file index.php Then type the php code below : phpinfo(); Save it and refresh the page in your browser. A phpinfo will appear.Thus the PHP extension is installed properly. If any of the pages do not appear try reinstalling apache server and its PHP extension.

PHP and HTML HTML stands for Hyper Text Markup Language. It is the standard markup language for creating Web pages. PHP is an HTML-embedded server side scripting language. Its goal is to allow web developers to write dynamically generated pages quickly PHP is designed to interact with HTML and PHP scripts can be included in HTML page without a problem. In an HTML page, PHP code is enclosed within special PHP tags which is <?php ?>

CODE Go back to your file index.php using the terminal and replace the code below:

Once you have typed all the code and checked it, save and exit the text editor with “Ctrl + x” then “y” then “enter”. IP Address

RGB LED

7 Color flash

Laser Module