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
int tempPin = A0; //Number of Temperature Sensor Pin | |
int analoginput; //Variable to store Analog Input Value | |
float temp; //Variable to store Temperature in C | |
void setup() | |
{ | |
// Begin the Serial Monitor at 9600 Baud | |
Serial.begin(9600); | |
} |
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 trigPin 13 | |
#define echoPin 12 | |
void setup() { | |
Serial.begin (9600); // Begin the Serial Monitor at 9600 Baud | |
pinMode(trigPin, OUTPUT); // Initialize Trigger Pin | |
pinMode(echoPin, INPUT); // Initialize Echo Pin | |
} | |
void loop() { |
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.h> //Library for LCD | |
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //initialize the library with the numbers of the interface pins | |
//The function parameter is as follows LiquidCrystal(rs, enable, d4, d5, d6, d7) | |
void setup() { | |
lcd.begin(16, 2); //Setup number of rows andcolumns of LCD | |
} | |
void loop() { |
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 LDR A0 //Initialize LDR sensor pin. | |
void setup() { | |
//Begin the Serial Monitor at 9600 Baud | |
Serial.begin(9600); | |
} | |
void loop() { | |
int value = analogRead(LDR); //Store sensor value to variable | |
Serial.println(value); //Print the value to serial |
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
int input1 = 11; //Number of Motor Input 1 Pin | |
int input2 = 9; //Number of Motor Input 2 Pin | |
void setup() { | |
pinMode(input1, OUTPUT); //Initialize Input 1 Pin | |
pinMode(input2, OUTPUT); //Initialize Input 2 Pin | |
} | |
void loop() { | |
analogWrite(input1, 0); //Write Analog value to Input 1 |
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
void setup() { | |
// initialize LED_BUILTIN as an output pin. | |
pinMode(LED_BUILTIN, OUTPUT); | |
} | |
void loop() { | |
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on | |
delay(1000); | |
digitalWrite(LED_BUILTIN, LOW); // turn the LED off | |
delay(1000); |
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
char mystr[5] = "Hello"; //String data | |
void setup() { | |
// Begin the Serial at 9600 Baud | |
Serial.begin(9600); | |
} | |
void loop() { | |
Serial.write(mystr,5); //Write the serial data | |
delay(1000); |
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
char mystr[10]; //Initialized variable to store recieved data | |
void setup() { | |
// Begin the Serial at 9600 Baud | |
Serial.begin(9600); | |
} | |
void loop() { | |
Serial.readBytes(mystr,5); //Read the serial data and store in var | |
Serial.println(mystr); //Print data on Serial Monitor |
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 <ESP8266WiFi.h> | |
#include <ESP8266WebServer.h> | |
ESP8266WebServer server(80); | |
const char* ssid = "WiFi_SSID"; //Enter Wi-Fi SSID | |
const char* password = "WiFi_Password"; //Enter Wi-Fi Password | |
void setup() { | |
Serial.begin(115200); //Begin Serial at 115200 Baud |
OlderNewer