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

    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

    CEIS100 W5 ILab Report

    • 320 Words
    • 2 Pages

    Code—copy and paste (or type) your code below. You can also post a screenshot of the program working if you would like.…

    • 320 Words
    • 2 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
  • Good Essays

    Nt1330 Unit 3 Quiz

    • 393 Words
    • 2 Pages

    The descriptions for the switches are as followed: -cbm: Create Bitmap Movie, -bmop: Bitmap Movie Output Path, -bmw: Bitmap Movie Window…

    • 393 Words
    • 2 Pages
    Good 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
  • Powerful Essays

    In the epic, The Odyssey, by Homer, there are many themes introduced in the first several books including manhood and loyalty. The first several books show us these themes through the hero entering the journey and realizing morals and ideas throughout the introduction.By doing this,themes and main points are revealed and are easier to identify for the rest of the story, and the characters, plot, and actions introduced in the first several books further foreshadows future later in the story.In this way, Homer leads a path that the reader can predict the theme through the first several books by indentifying those aspects and elements of the epic.…

    • 969 Words
    • 4 Pages
    Powerful 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
  • 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