Name: Omkar Nandu Patil USN: 2JI18EC110 Roll No. /DIV: 52/A Sub: Embedded System
Name: Omkar Nandu Patil USN: 2JI18EC110 Roll No. /DIV: 52/A Sub: Embedded System
Name: Omkar Nandu Patil USN: 2JI18EC110 Roll No. /DIV: 52/A Sub: Embedded System
USN: 2JI18EC110
❖ Experiment No. 1
Circuit diagram:
Simulation output :
Program :
#include <Stepper.h>
int DCMotor = 2;
int PushButton = 7;
int stepCount = 0;
void setup() {
pinMode(PushButton, INPUT);
pinMode(DCMotor , OUTPUT);
}
void loop() {
if (motorSpeed > 0) {
myStepper.setSpeed(motorSpeed);
myStepper.step(stepsPerRevolution / 100);
if(estadoBoton == 1){
digitalWrite(DCMotor , HIGH);
} else{
digitalWrite(DCMotor , LOW);
}
❖ Experiment No. 2
Circuit diagram:
Simulation output :
Serial Monitor
Program :
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
int celsius;
void setup()
Serial.begin(9600);
void loop(){
lcd.setCursor(0,0);
lcd.print("Temp Display");
lcd.setCursor(0,1);
lcd.print(celsius);
delay(1000);
lcd.clear();
}
❖ Experiment No. 3
Circuit diagram:
Simulation output :
Program :
void setup()
pinMode(3, OUTPUT);
void loop()
digitalWrite(3, HIGH);
digitalWrite(3, LOW);
}
❖ Experiment No. 4
Circuit diagram:
Simulation output :
Program:
void setup() {
pinMode(trig_pin, OUTPUT);
void loop() {
digitalWrite(trig_pin,HIGH);
delay(1000);
digitalWrite(trig_pin, LOW);
delay(1000);
}
❖ Experiment No. 5
Circuit Diagram:
Simulation output:
Serial Monitor :
Program:
#include <Keypad.h>
char keymap[numRows][numCols]=
};
void setup()
Serial.begin(9600);
void loop()
if (keypressed != NO_KEY)
Serial.println(keypressed);
}
❖ Experiment No. 6
Aim: Interfacing LED ON/OFF using external interrupts using TINKERCAD Tool.
Components: Arduino Uno, Resistor (10k ohm and 220 ohm), LED, Push
Button, Connecting wires.
Circuit Diagram:
Simulation output:
Program:
int ledpin=11;
int btnpin=2;
void setup()
pinMode(ledpin,OUTPUT);
pinMode(btnpin, INPUT);
void loop()
if(digitalRead(btnpin)==LOW)
delay(10);
if(digitalRead(btnpin)==LOW)
while(digitalRead(btnpin) == LOW);
delay(10);
while(digitalRead(btnpin)==LOW);
state = !state;
digitalWrite(ledpin,state);
}
❖ Experiment No. 7
Circuit diagram:
Simulation output:
Serial Monitor:
Program:
void setup() {
Serial.begin(9600);
void loop() {
Serial.readBytes(mystr,5);
Serial.println(mystr);
delay(1000);
}*/
int val,T;
void setup() {
pinMode(6,OUTPUT);
digitalWrite(6,LOW);
Serial.begin(9600);
void loop() {
delay(1000);
int v = Serial.read();
/* if(T>=30)
digitalWrite(6,HIGH);
delay(5000);
else
digitalWrite(6,LOW);
delay(1000);
}*/
delay(1000);
}
❖ Experiment No. 8
Circuit diagram:
Simulation output:
Program:
void rampa() {
for(int n=0;n<255;n++){
analogWrite(led, n);
delay(5);
void setup() {
pinMode(led, OUTPUT);
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}