Skip to content

Instantly share code, notes, and snippets.

View dsijanov's full-sized avatar

Davor Sijanovic dsijanov

View GitHub Profile
#include <Servo.h>
Servo tragac; //It creates a servo object that manages the servo.
int istokPin = 1; //It adds analog pins connected to the light sensor
int zapadPin = 2;
int istokVal = 0; //It creates variables that store sensor values.
int zapadVal = 0;
#include <Servo.h> //It adds the library to the program.
#include <LiquidCrystal.h>
Servo rampa; //It creates a servo object that manages the servo.
int izlaz = 0; //Pin attached to the sensor at the exit.
int ulaz = 1; //Pin attached to the sensor at the entrance.
int spusteno = 177; //Position of the ramp down.
int dignuto = 90; //Position of the ramp up.
int crvenoGlavna = 2;
int zutoGlavna = 1;
int zelenoGlavna = 0;
int crvenoSporedna = 5;
int zutoSporedna = 4;
int zelenoSporedna = 3;
int senzor1 = 6;
int senzor2 = 7;
#include <FadeLed.h> //It adds library for LED diode management.
FadeLed leds[5] = {3, 5, 6, 9, 10}; //It adds LED pins to the "leds" object.
unsigned long millisLast; //variable millisLast
int resPin = A1; //It defines photoresistor pin.
int resValue = 0; //A variable for storing the value of photoresistors.
int sensPin1 = 2; //It defines infrared sensor pins.
int sensPin2 = 4;