Preview

Arduino Parking Lot

Good Essays
Open Document
Open Document
340 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Arduino Parking Lot
Here is the code:
/*ParkingL02.pde
Arduining.com 08 JUL 2012
Code used in the production of the Youtube material.
*/

#include <Servo.h>
Servo myservo; // create servo object to control a servo

#define ServoM 12 //Connected to the servo motor.
#define Bright 11 //servo library disable PWM on pins 9 and 10.
#define Exit 9 //Pin connected to the EXIT button.
#define In 8 //Pin connected to the IN button.

#define BarLow 177 //Low position of the barrier.
#define BarUp 95 //Up position of the barrier.
#define CAPACITY 8 //Capacity of the parking lot.
#define INTEN 80 //Display intensity %

//Pins conections to segments (cathodes).
#define segA 0
#define segB 1
#define segC 2
#define segD 3
#define segE 4
#define segF 5
#define segG 6

//Array with the segments to represent the decimal numbers (0-9). byte segments[10] = {
// pgfedcba <--- segments B00111111, // number 0 B00000110, // number 1 B01011011, // number 2 B01001111, // number 3 B01100110, // number 4 B01101101, // number 5 B01111101, // number 6 B00000111, // number 7 B01111111, // number 8 B01101111 // number 9
};

void setup(){ myservo.attach(ServoM); // attaches the servo.

pinMode(Exit, INPUT); // set "EXIT" button pin to input pinMode(In, INPUT); // set "IN" button pin to input digitalWrite(Exit, HIGH); // Connect Pull-Up resistor. digitalWrite(In, HIGH); // Connect Pull-Up resistor. pinMode(segA,OUTPUT); pinMode(segB,OUTPUT); pinMode(segC,OUTPUT); pinMode(segD,OUTPUT); pinMode(segE,OUTPUT); pinMode(segF,OUTPUT); pinMode(segG,OUTPUT); pinMode(Bright,OUTPUT); analogWrite(Bright,255*INTEN/100); myservo.write(BarLow); //Barrier in the low position
// delay(1000);
}

int Available= 9; // Number of places available.

You May Also Find These Documents Helpful

  • Satisfactory Essays

    ECT114 week 3 lab

    • 299 Words
    • 2 Pages

    e. Write a technical statement describing the circuit configuration and behavior of Figure 1. Include the name of the logic circuit a written interpretation of the function table. (2 points)…

    • 299 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Paper II - Section : II Embedded Systems INDEX No 1 2 3 4 5 6 7 8 9 10 Toggle Port LED Simulate Binary Counter at Port Generate delay using TIMER_0 Stepper Motor (clockwise/Anticlockwise) Generating square wave at port pin Generating Triangular wave at port pin Sine wave generation using look-up table Microcontrollers communicating over a serial link Read switch-status from i/p port and display at o/p port Using Input Capture Pin (ICP), measure pulse width & display at o/p port Topic Date 6-9-2010 9-9-2010 17-9-2010 24-9-2010 8-10-2010 15-10-2010 15-10-2010 29-10-2010 22-11-2010 24-11-2010 Page 02 03 04 06 07 09 10 11 13 15 Sign…

    • 742 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    CODE FOR THE ABOVE FRAGMENT addi $t6, $zero, 101 # the loop termination value add $t0, $zero, $zero # i = 0 addi $t2, $a0, 0 # ptr to current A[i] addi $t3, $a1, 0 # ptr to current B[i] loop: lw $t4, 0($t3) # load B[i] add $t4, $t4, $s0 # B[i] + c sw $t4, 0($t2) # store in A[i] addi $t0, $t0, 1 # i++ addi $t2, $t2, 4 # ptr to next A[i] addi $t3, $t3, 4 # ptr to next B[i] bne $t0, $t6, loop # if i < 101, goto loop IF ANY QUERIES REGARDING CODE…

    • 107 Words
    • 1 Page
    Powerful Essays
  • Satisfactory Essays

    Kama Deposits Paper

    • 571 Words
    • 3 Pages

    1. Prepare a bank deposit detail for a $2230.00 deposit. Use the information in questions A-D. Record your answers to the deposit slip provided.…

    • 571 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    2.Write a program to (a) display a “?” (b) read two decimal digits whose sum less than 10 (c) display them and their sum on the next line. Page: 80…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    En1320 Unit 1 Research Paper 1

    • 27742 Words
    • 111 Pages

    in register R3. This code is simple, and it does not express all the instructions needed to…

    • 27742 Words
    • 111 Pages
    Powerful Essays
  • Better Essays

    Nt1310 Unit 1 Assignment

    • 1994 Words
    • 8 Pages

    5. Convert 32 decimal to binary floating point. Use a 6 bit mantissa and a 4 bit exponent.…

    • 1994 Words
    • 8 Pages
    Better Essays
  • Satisfactory Essays

    Muscle Physiology

    • 593 Words
    • 6 Pages

    Are there any safety concerns associated with this exercise? If so, list what they are and what precautions should be taken.…

    • 593 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    *Laser Grid/Polar( tell the FDC if it’s a lazer, i.e ADJ Fire Laser Polar Over)…

    • 613 Words
    • 8 Pages
    Satisfactory Essays
  • Satisfactory Essays

    To determine which alternative layout is better we calculate the weighted distance, wd, scores of the two block plans.…

    • 448 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Highest Paid Wpmen

    • 509 Words
    • 3 Pages

    In your own words, interpret the data and note the shape of the distribution of the data provided from the Case Study: Highest Paid Women (Chapter 2, p. 35). To help guide your interpretation, include the following:…

    • 509 Words
    • 3 Pages
    Good Essays
  • Good Essays

    The majority of property owners in the United States understand the importance of the regulations stated in the Americans With Disability Act of 1990, also known as the ADA. After all, these rules are about providing safe, identifiable and fair entrance and exit into and out of buildings, rooms or areas within said structures and even the parking lots for those who suffer from various types of disabilities. At present, not all property owners take steps to comply with these regulations, and this fact is quite evident here in California. Citizens in this state have the right to file a lawsuit against the public establishments when they do not offer the correct ADA signs or California Handicap Parking signs.…

    • 627 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    NT1210 Unit Lab 1

    • 421 Words
    • 18 Pages

    1.) Write out the powers starting from 20 to 26. Next place the values of the powers below. In each block below enter a one subtract that value from the number 127 until you have nothing remaining and all values equal 127.…

    • 421 Words
    • 18 Pages
    Satisfactory Essays
  • Good Essays

    Pure Competition

    • 1363 Words
    • 6 Pages

    (Key Question) Complete the following labor demand table for a firm that is hiring labor competitively and selling its product in a competitive market.…

    • 1363 Words
    • 6 Pages
    Good Essays
  • Powerful Essays

    My Notes

    • 9122 Words
    • 37 Pages

    ==Use NotePad++ To Edit. Highlight StevenStar18 and Hold CTRL+H and replace with your PSN for some mods to work.============================================…

    • 9122 Words
    • 37 Pages
    Powerful Essays

Related Topics