Car Park with Arduino Uno

Hello everyone

I ask you for a little help with a school project that I am doing and I am using an Arduino Uno. The project is a car park for 8 spaces with a free indicator park and park complete with an inlet and an outlet (using servos) and if possible a 7-segment display (which indicate the number of vacancies in park). My idea was that if a car was to enter the park opened the barrier for 5 seconds and after that time the barrier closes and this car is added to the count and exit when a car is about to leave the barrier opens and closes after 5 seconds a car and is taken to the count. When the park is full, the red light comes on and as soon as a car leaves the red light turns off and turns on the green light.

Will can give me a little help?

Help with what? The electronics, the code or the idea?
If this is to be a real carpark entry system and your barrier comes down after 5 seconds it will probably damage every car that enters and leaves! What you need to do is to detect when the car has left the area of the barrier before you let the barrier come down.

The park is just like a model. And just need help with the program the Arduino.

When I'm going to upload the program to the Arduino it gives me some errors in variables. Will could give me a hand with the program?

Tuba121:
When I'm going to upload the program to the Arduino it gives me some errors in variables. Will could give me a hand with the program?

Show us your code, use "#" to insert code.
What error message?

The code is:

Parque_de_Estacionamento.ino (2.61 KB)

Well, I took the trouble to download your code, then put in my IDE andhit the compile button to get your error messages. Life would be easier if you did those things --> http://arduino.cc/forum/index.php/topic,148850.0.html see the end of section 7.


Your problem is

const int One = 3 , 4;

and lines like that.
How can one constant (or variable for that matter) hold several values? It can not. From your program I can not guess what you meant by that.
if(COUNTER<1Car)is flagged as invalid suffix "Car" on integer constant
Your problem is that you can not combine a number "1" with "Car" like that. I can not guess if you meant 1+Car or a variable named "one_car".

First make some little program that turns LED 1 on if you hit the "add car" and off when you hit the "subtract car". I think that will help you understand some basic syntax of C. After that we can look into the flow of your program logic.