February 2015
Beginner
206 pages
4h 16m
English
Since the code of this project is perhaps a little longer than the previous examples, I will present it first by sections without comments and include the complete code for reference at the end of this chapter.
We begin our code by including the servo library that we will use to deal with the servomotor that will operate the retractable roof. We define constants that will be used all along the code as follows:
#include <Servo.h> #define redLedPin 13 #define yellowLedPin 12 #define greenLedPin 11 #define relayPin 8 #define motorPin 6 #define buzzerPin 4 #define servoPin 3 #define buttonPin 2 #define potentiometerPin 2 #define thermistorPin 1 #define photocellPin 0 #define NOTE_A4 440 ...
Read now
Unlock full access