/* Arduino FallerCarVisp2.4verklaringen:wisselX=wisselstopX=stopplaats5 pins totaal; 2 PWM;bevat:wissel 9;stopplaats 11;reed1;com3-> & com3<-;©2015, Johan Verzijden, VSZBoard: Micro*/#include <Servo.h>//Servo's:Servo wissel9;Servo stop11;//posities://posities voor wissel9:int pos09 = 90;int pos9 = 44;//posities voor stop11:int pos011 = 0;int pos11 = 180;//INPUT(reed) op pins:int reed1 = 10;//communicatie met AR3 op pins:int com3-> = 1;int com3<- = 0;void setup (){//servo's op pins:wissel9.attach(9);stop11.attach(11);//reed als INPUT;pinMode(reed1, INPUT);//com. als IN- & OUTPUT:pinMode(com3->, OUTPUT);pinMode(com3<-, INPUT);}void loop (){//wissel9 op rechtdoor:wissel9.write(pos09);//stop11 uit:stop11.write(pos011);//bushalte:if(digitalRead(reed1) == HIGH) //bus wordt gedetecteerd:{wissel9.write(pos9); //wissel9 op afbuigendstop11.write(pos11); //stop11 aan -> bus stoptdelay(5000); //wacht 5 secwissel9.write(pos09); //wissel9 op rechtdoordelay(15000); //wacht 15 secstop11.write(pos011); //stop11 uit//bus rijdt weg bij halte;}}//END