This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> // Include the Servo library | |
int servoPin = 3; | |
const int trigPin = 9; | |
const int echoPin = 10; | |
Servo myServo; // Create a servo object | |
int val = 0; | |
long duration; | |
int distance; | |
void setup() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import processing.serial.*; | |
import controlP5.*; | |
Serial myPort; | |
ControlP5 cp5; | |
ControlGroup messageBox; | |
String data = "0"; | |
void setup() { | |
size(500,430); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SENSOR 2 | |
#define PIEZO 8 | |
#define NOTE_G4 392 | |
#define NOTE_C5 523 | |
#define NOTE_G5 784 | |
#define NOTE_C6 1047 | |
int Sound[] = {NOTE_G5, NOTE_C6}; | |
int SoundNoteDurations[] = {12, 8}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Melody | |
Plays a melody | |
circuit: | |
- 8 ohm speaker on digital pin 8 | |
created 21 Jan 2010 | |
modified 30 Aug 2011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include IR Remote Library by Ken Shirriff | |
#include <IRremote.h> | |
// Define sensor pin | |
const int RECV_PIN = 4; | |
// Define LED pin | |
#define RED 8 | |
#define GREEN 9 | |
#define YELLOW 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
Servo myservo1; | |
Servo myservo2; | |
int touchSensorPin = 2; | |
int touchSensorState = 0; | |
void setup() { | |
myservo1.attach(9); | |
myservo2.attach(10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <Wire.h> | |
#include <Adafruit_GFX.h> | |
#include <Adafruit_SSD1306.h> | |
#include "DHT.h" | |
#define SCREEN_WIDTH 128 // OLED display width, in pixels | |
#define SCREEN_HEIGHT 64 // OLED display height, in pixels | |
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x27, 20, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display | |
#include <Keypad.h> | |
const byte ROWS = 4; | |
const byte COLS = 4; | |
char keys [ROWS] [COLS] = { | |
{'1', '2', '3', '+'}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> // Include the library for the servo | |
#define RAIN_SENSOR A0 | |
#define SERVO1_PIN 10 | |
#define SERVO2_PIN 11 | |
Servo myservo1; // Create servo object to control a servo | |
Servo myservo2; | |
int rainAdc = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BLYNK_PRINT Serial | |
#include <WiFi.h> | |
#include <WiFiClient.h> | |
#include <BlynkSimpleEsp32.h> | |
// You should get Auth Token in the Blynk App. | |
// Go to the Project Settings (nut icon). | |
char auth[] = "YourAuthToken"; | |
// Your WiFi credentials. |