Basic Stamp OEM module By Wilmer Arellano. OEM BASIC Stamp 2sx Wiring diagram Note: - is connection to negative pole of the battery 220 Ohm Push button.

Slides:



Advertisements
Similar presentations
IGCSE ICT Control Systems.
Advertisements

Flowchart What is a flowchart? A flowchart is a schematic representation of an algorithm or a process or a program. Why should a flowchart be produce before.
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.
Light Emitting Diode: LED. What is an LED?  Light-emitting diode  Semiconductor  Has polarity.
Basic Stamp II is kinda cool Bytes of EEPROM(non-volatile) - Clock speed of 20 MHz. - Holds 600 lines of code in EEPROM - executes an average of.
ENGR 101: Robotics Lecture 2 – Text Programming Outline  Introduction to PBASIC  Variables, I/O, Arithmetic  Controlling the LEDs References 
Input and Output Developed by: Electronic Systems Technologies College of Applied Sciences and Arts Southern Illinois University Carbondale
Introduction.
Algorithm & Flowchart.
LSU 06/04/2007BASIC Stamp Editor1 The BASIC Stamp Editor Programming Unit, Lecture 3.
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Andy.
Electronics / Modelling in Livewire & PCB Wizard
PICS / Microcontrollers
Basic Stamp Quick Start. Basic Stamp II Self contained computer –“Micro-controller” Specialized for “embedded” computing (sensing and controlling things)
MICROCONTROLLERS MODULE 2 Programming, Controlling and Monitoring.
Programmable Systems  Electronic devices have been developed to make life more enjoyable, easier, safer or more productive.  Some examples: Microwave.
BASIC Stamp Editor Once installed, the Stamp Editor will be available on your desktop, and as a menu option under Start  Program Files  Parallax Inc.
Programmable Logic Controllers
Last week’s project demos Servo control with photoresistor and enable/disable buttons Demo in class tonight – don’t start on the next project until I’ve.
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Jessica.
Last week’s project demos Servo control with potentiometer and enable/disable buttons Demo in class tonight – don’t start on the next project until I’ve.
The Basic Stamp Instruction Set Architecture. The Microprocessor A microprocessor is a computer that typically has an architecture that is well suited.
1 Basic Electronics Voltage (V or E): Potential difference between 2 points. Volts. (+) - A lack of electrons (-) – A surplus of electrons When a circuit.
Controlling the Outside World
Programming the CheapBot-14. Start the Editor Set the Mode.
Looking at systems. What is a SYSTEM? The radiator makes the room warmer by turning ON when the temperature of the room is lower than required The THERMOSTAT.
Truth tables AND Gate Input 1Input output ? ? ? ? Input 1Input output ? ? ? ? OR Gate.
Software and documentation Download and install: “Setup-Stamp-Editor-Lrg-v2.2.6.exe”  Downloads  BASIC Stamp software BASIC Stamp Syntax.
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. 
1 Parallax BASIC Stamp ® Tutorial Developed by: Electronic Systems Technologies College of Applied Sciences and Arts Southern Illinois University Carbondale.
Microcontroller I Seth Price Department of Chemical Engineering New Mexico Tech Rev. 9/22/14.
Digital Electronics Board-of-Education : Input. Board of Education - Input This presentation will explain, both from a hardware and software perspective,
ME456: Mechatronics Systems Design Lecture 3 Chapter 2: Lights On –Lights Off Prof. Clark J. Radcliffe Mechanical Engineering Michigan State University.
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Andy.
ENGR 101: Robotics Lecture 3 – Robot Motion Outline  Robot Motion  FOR Loops  Making Music References 
ENGR 101: Robotics Lecture 4 – Making Decisions Outline  The Stall Sensor  Making Decisions  Random Number Generation References 
July 7, 2003 Slide 1 of 6 Automation, Robotics and Mechatronics Lab, SUNY at Buffalo Introduction To Programming Chetan Jadhav Talib Bhabharawala Seung-Kook.
TEKS 5.6B Demonstrate that the flow of electricity in circuits requires a complete path through which an electric current can pass and can produce light,
Prepared by: Engr. Qurban Ali Memon 11ES (SEC- 1 & 2)
Slide Menlo Drive Suite 100 Rocklin, CA
Slide 1 Chapter #7: Measuring Light Light Sensor Circuit Parts (1) (1)Resistor – 220 Ω (red-red-brown) (1) Capacitor – 0.1  F (1) Capacitor – 0.01  F.
Slide 1 Flowchart with loop Start Is light less than 50? Turn lamp on Yes No.
ME456:Mechatronics WAM Chapter 1: Getting Started Prof. Clark J. Radcliffe Mechanical Engineering Michigan State University
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. 
Digital Electronics Board-of-Education : Output. Board of Education - Output This presentation will explain, both from a hardware and software perspective,
System A collection of parts that perform a function.
18240 Element two - Components INPUTS OUTPUTS PURPOSE TYPICAL USE.
Traditionally ladder logic programs have been written by thinking about the process and then beginning to write the program. This always leads to programs.
 Electric charges move in a looped path called a circuit – starts and ends in the SAME spot  A simple circuit contains a source of energy and at least.
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. 
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. 
Innovation First Hardware & Default Program The 5¢ Tour... Dr. Joe January 5, 2002.
1 Microcontrollers. 2 Programmers work in the virtual world Machinery works in the physical world Microcontrollers connect the virtual and physical world.
Slide Menlo Drive Suite 100 Rocklin, CA
Sensors Control Systems with Flowol.
Home automation using Arduino & ‘PIR sensor’
OEM BASIC Stamp 2sx 220 Ohm.
You have 5 minutes to look over your homework and with a green pen answer the question in your book or make a correction Start Timer 5 mins
fischertechnik® RoboPro Software for Gateway To Technology® RoboPro
fischertechnik® RoboPro Software for Gateway To Technology® RoboPro
Programming Boe-Bots (Part 1)
Input-Output-Process Demo
Fevzi Ozaydin & Violet Mwaffo
Lab 1. Introduction to the DE2 Board
Objectives Construct truth tables for the following logic gates:
Programming the BASIC Stamp
TEKS 5.6B Demonstrate that the flow of electricity in circuits requires a complete path through which an electric current can pass and can produce light,
Interface ckt for demo Outputs Inputs V PIN 0 10K PIN 4 GND GND
Presentation transcript:

Basic Stamp OEM module By Wilmer Arellano

OEM BASIC Stamp 2sx Wiring diagram Note: - is connection to negative pole of the battery 220 Ohm Push button Buzzer LED OUT PIR Motion sensor 9 V battery COM port Microcontroller chip 15 KOhm

' {$STAMP BS2} ' {$PBASIC 2.5} OUTPUT 4 'PIN 4 Declared as output INPUT 0 'PIN 0 Declared as input Green: OUT4=IN0 'PIN 4 will take the value of PIN 0 (switch) PAUSE 1000 GOTO Green Turn ON LED with Switch Input Output Declarations

Variables Bit 0 or 1 Nibble (Nib) 0-15 Byte0-255 Word or to

' {$STAMP BS2} ' {$PBASIC 2.5} NS VAR Bit 'NS is a Bit Variable EW VAR Bit 'EW is a Bit Variable TOTAL VAR Byte 'TOTAL is a Byte Variable NOC CON 20 'NOC is a constant TOTAL = 0 OUTPUT 4 INPUT 1 TOTAL = TOTAL +100 DEBUG ? TOTAL TOTAL= TOTAL/3 DEBUG ? TOTAL DEBUG ? NOC Arithmetic Example

Pseudo Code Start of program Measure temperature  Temperature < 100 F? Yes, Turn on heat  Temperature > 102 F? Yes, Turn on cooling fan Go back to start.

7 Start Measure Temperature Temp. < 100 Energize Heater Temp. > 102 Energize Fan Star t Yes No Yes No Flowchart

8 Sequential Flow Example Pseudo-Code: Start of program  Turn off LED 1  Turn off LED 2  Pause for 2 seconds  Light LED 1  Pause for 2 seconds  Light LED 2  End of program Flowchart: ' {$STAMP BS2} ' {$PBASIC 2.5} LED_OFF CON 0 'LED_OFF is a constant of value 0 LED_ON CON 1 'LED_ON is a constant of value 1 start: OUTPUT 4 OUTPUT 15 OUT4 =LED_OFF OUT15 =LED_OFF PAUSE 1000 OUT4 =LED_ON OUT15 =LED_ON PAUSE 1000 GOTO startCode: Start Turn OFF LED1 Turn OFF LED2 2 Second Pause Turn ON LED1 Turn ON LED2 2 Second Pause End

Branching Overview - GOTO Branching is the act of breaking out of a sequence to perform code in another location of the program. The simplest form of branching is to use the GOTO instruction: GOTO label ' {$STAMP BS2} ' {$PBASIC 2.5} OUTPUT 4 'PIN 4 Declared as output INPUT 0 'PIN 0 Declared as input Green: OUT4=IN0 'PIN 4 will take the value of PIN 0 (switch) PAUSE 1000 GOTO Green

Conditionals Overview The previous example is an unconditional branch; the program will branch back to Main regardless of any code parameters. In a conditional branch a decision is made based on a current condition to branch or not to branch. As humans, we constantly make decisions based on input as to what to perform. Shower too cold? Turn up the hot. Shower too hot? Turn down the hot water. Microcontrollers can be programmed to act based on conditions

IF…THEN The IF-THEN is the primary means of conditional branching. IF condition THEN addressLabel If the condition is evaluated to be true, execution will branch to the named address label. If the condition is not true, execution will continue to the next step in the program sequence. A condition is typically an equality: value1 = value2 value1 > value2 value1 < value2 IN8 = 1

12 IF-THEN Example: Alarm  This program will sound the alarm as long as pushbutton 1 is pressed. Start: Is button 1 pressed?Is button 1 pressed? Yes, Go sound AlarmYes, Go sound Alarm No, Go back to startNo, Go back to startAlarm Sound speakerSound speaker Go back to start of programGo back to start of program ' {$STAMP BS2} ' {$PBASIC 2.5} SWITCH VAR Bit start: SWITCH=IN0 IF SWITCH=1 THEN buzz 'IF switch is pressed then turn on buzzer GOTO start buzz: FREQOUT 1, 1000, 5000 GOTO start Pseudo-Code Flowchart Program Code Button 1 Pressed Main Speaker 2000Hz for 1 second Main TrueFalse

' {$STAMP BS2} ' {$PBASIC 2.5} NS VAR Bit EW VAR Bit OUTPUT 4 OUTPUT 10 INPUT 1 Green: OUT4=1 OUT10=0 NS=IN1 IF NS=1 THEN green OUT4=0 OUT10=1 PAUSE GOTO Green What does this program do?