Arduino
11. Συναγερμός
/* PIR sensor alarm */ // constants won’t change. They’re used here to // set pin numbers: // in Pin 2 we will connect the PIR sensor // signal. Give it a name. const int pirPin = 2; // in Pin 12 we will connect the piezoelectric // speaker. Διαβάστε περισσότερα…
Arduino
10. Ανεμιστήρας
/* Make the motor spin while the pushbutton is pressed and stop it when the pushbutton is released. */ // constants won’t change. They’re used here to // set pin numbers: // in Pin 9 we will connect the motor control // signal. Give it a name. const int Διαβάστε περισσότερα…
Arduino
9. Ψηφιακό θερμόμετρο χώρου
/* Display temperature in an LCD display in celsius */ // include LCD library headers #include <LiquidCrystal.h> // constants won’t change. They’re used here to // set pin numbers: // in Pin 0 we will connect the temperature // sensor. Give it a name. const int tempPin = 0; Διαβάστε περισσότερα…
Arduino
8. Οθόνη μηνυμάτων
/* Display messages in an LCD display */ // include LCD library headers #include <LiquidCrystal.h> // setup LCD // RS E D4 D5 D6 D7 LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // the setup routine runs once when you press // reset: void setup() { // initialize the Διαβάστε περισσότερα…
Arduino
7. Μουσικό όργανο Theremin
/* Theremin like music organ to play sounds it will change the pitch of the note as you wave your hand in front of it */ // constants won’t change. They’re used here to // set pin numbers: // in Pin 12 we will connect the piezo speaker. // Διαβάστε περισσότερα…
Arduino
6. Μουσικοί ήχοι
/* Make simple sounds */ // constants won’t change. They’re used here to // set pin numbers: // in Pin 12 we will connect the piezo speaker. // Give it a name. const int speakerPin = 12; // the number of tones to play const int numTones = Διαβάστε περισσότερα…
Arduino
5. Χρωματικό θερμόμετρο
/* Display temperature as a color bar */ // constants won’t change. They’re used here to // set pin numbers: // in Pin 0 we will connect the temperature // sensor. Give it a name. const int tempPin = 0; // in Pin 2 we will connect the Διαβάστε περισσότερα…
Arduino
4. Φανάρι κυκλοφορίας με κουμπί πεζών
/* Traffic light with a pedestrian button */ // constants won’t change. They’re used here to // set pin numbers: // in Pin 12 we will connect the car red LED. // Give it a name. int carRed = 12; // in Pin 11 we will connect the car Διαβάστε περισσότερα…
Arduino
3. Φανάρι κυκλοφορίας
/* Traffic light */ // constants won’t change. They’re used here to // set pin numbers: // in Pin 12 we will connect the car red LED. // Give it a name. int carRed = 12; // in Pin 11 we will connect the car yellow LED. // Give Διαβάστε περισσότερα…