i'm working on a school project "automatic railway system" my project suppose to close the gate when the train coming to the station with a buzzer on with 90 sec count down display on 7-seg. and a led flashing. after the train leaving the station, the gate opens and the buzzer off and the led off . i tried to use a dc motor to open and close the gate but it didn't give me the accurate angle that i need to i try to use a servo motor . so i need it to open the gate at position zero and close it at position 90 . all the code i found on the internet they using PWM and timers which i didn't take it in my course , so can anyone help me to do this with simple code ,please ?
i'm using Atmega32 running at 16000000 HZ