SlideShare a Scribd company logo
void setup(){
Serial.begin(9600);
pinMode(A0, INPUT);
}
void loop() {
val = analogRead(A0);
float mv = (val/1024) *5000;
float cel = mv/10;
float far = (cel*9)/5 + 32;
Serial.print("TEMPERATURE = ");
Serial.print(cel);
Serial.print(" degree Celsius or ");
Serial.print(far);
Serial.print(" degree Fahrenheit");
Serial.println();
delay(1000);
}
#include<dht.h>
dht DHT;
void setup ()
{
Serial.begin(9600);
pinMode(A0,INPUT);
}
void loop ()
{
DHT.read11(A0);
Serial.print(“ Humidity = “);
Serial.print(DHT.humidity);
Serial.print(“%t”);
Serial.print(“ Temperature = “);
Serial.print(DHT.temperature);
Serial.println();
delay(5000);
}
#include<Servo.h>
Servomyservo;
intpotpin=0;
int val;
void setup() {
myservo.attach(9);
}
void loop() {
val = analogRead(potpin);
val = map(val,0,1023,0,180);
myservo.write(val);
delay(10);
}
#include <Stepper.h> // Include the header file
// change this to the number of steps on your motor
#define STEPS 32
// create an instance of the stepper class using the steps and pins
Stepper stepper(STEPS,8,10, 9, 11);
int Pval = 0;
int potVal = 0;
void setup() {
Serial.begin(9600);
stepper.setSpeed(200);
}
void loop() {
potVal = analogRead(A0);
potVal = map(potVal,0,1024,0,500);
if (potVal>Pval)
stepper.step(5);
if (potVal<Pval)
stepper.step(-5);
Pval = potVal;
}
int motorpin1 = 6;
int motorpin2 = 7;
void setup ()
{
pinMode(motorpin1, OUTPUT);
pinMode(motorpin2, OUTPUT);
}
void loop ()
{
digitalWrite(motorpin1, LOW);
digitalWrite(motorpin2, HIGH);
}
int sensorPin =A0;
int sensorValue =0;
void setup ()
{
Serial.begin(9600);
}
void loop ()
{
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
delay(1000);
}

More Related Content

What's hot (20)

Cd
CdCd
Cd
Madhur Diwan
 
week-17x
week-17xweek-17x
week-17x
KITE www.kitecolleges.com
 
DataStructures notes
DataStructures notesDataStructures notes
DataStructures notes
Lakshmi Sarvani Videla
 
Double linked list
Double linked listDouble linked list
Double linked list
Sayantan Sur
 
งานนำเสนอ อาจารย์ลาวัลย์
งานนำเสนอ อาจารย์ลาวัลย์งานนำเสนอ อาจารย์ลาวัลย์
งานนำเสนอ อาจารย์ลาวัลย์
น้ำตาล มาแล้วจ้า
 
Conditional Control
Conditional ControlConditional Control
Conditional Control
Anar Godjaev
 
Datastructures asignment
Datastructures asignmentDatastructures asignment
Datastructures asignment
sreekanth3dce
 
โปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐานโปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐาน
knang
 
Menu Driven programs in Java
Menu Driven programs in JavaMenu Driven programs in Java
Menu Driven programs in Java
Lakshmi Sarvani Videla
 
week-18x
week-18xweek-18x
week-18x
KITE www.kitecolleges.com
 
C Prog - Strings
C Prog - StringsC Prog - Strings
C Prog - Strings
vinay arora
 
C Prog. - Structures
C Prog. - StructuresC Prog. - Structures
C Prog. - Structures
vinay arora
 
C programms
C programmsC programms
C programms
Mukund Gandrakota
 
C Language - Switch and For Loop
C Language - Switch and For LoopC Language - Switch and For Loop
C Language - Switch and For Loop
Sukrit Gupta
 
C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
Malikireddy Bramhananda Reddy
 
SLIME
SLIMESLIME
SLIME
chaitanyagupta
 
One dimensional operation of Array in C- language
One dimensional operation of Array in C- language One dimensional operation of Array in C- language
One dimensional operation of Array in C- language
9096308941
 
week-11x
week-11xweek-11x
week-11x
KITE www.kitecolleges.com
 
LAB PROGRAMS SARASWATHI RAMALINGAM
LAB PROGRAMS SARASWATHI RAMALINGAMLAB PROGRAMS SARASWATHI RAMALINGAM
LAB PROGRAMS SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
StewartPlatform_cpp
StewartPlatform_cppStewartPlatform_cpp
StewartPlatform_cpp
Carlos Alonso
 

Similar to Arduino Code (20)

IoTA Unit 3.pptx programming and interfaces sensor
IoTA Unit 3.pptx programming and interfaces sensorIoTA Unit 3.pptx programming and interfaces sensor
IoTA Unit 3.pptx programming and interfaces sensor
Harini737456
 
INT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdfINT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdf
MSingh88
 
OpenBot-Code
OpenBot-CodeOpenBot-Code
OpenBot-Code
Anshuman Dhar
 
Open bot
Open bot Open bot
Open bot
Anshuman Dhar
 
Introduction to Arduino and Circuits
Introduction to Arduino and CircuitsIntroduction to Arduino and Circuits
Introduction to Arduino and Circuits
Jason Griffey
 
Sensors and Actuators in Arduino, Introduction
Sensors and Actuators in Arduino, IntroductionSensors and Actuators in Arduino, Introduction
Sensors and Actuators in Arduino, Introduction
BibekPokhrel13
 
Edge_AI_Assignment_3.pdf
Edge_AI_Assignment_3.pdfEdge_AI_Assignment_3.pdf
Edge_AI_Assignment_3.pdf
ShivamMishra603376
 
Wireless humidity and temperature monitoring system
Wireless humidity and temperature monitoring systemWireless humidity and temperature monitoring system
Wireless humidity and temperature monitoring system
Sagar Srivastav
 
[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노
Chiwon Song
 
Musical Machines and Flapping Phones
Musical Machines and Flapping PhonesMusical Machines and Flapping Phones
Musical Machines and Flapping Phones
Neil Mendoza
 
A Wireless Application of The Rain, Humidity and Temperature Sensors Based on...
A Wireless Application of The Rain, Humidity and Temperature Sensors Based on...A Wireless Application of The Rain, Humidity and Temperature Sensors Based on...
A Wireless Application of The Rain, Humidity and Temperature Sensors Based on...
政德 劉
 
Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.
Ankita Tiwari
 
Codes
CodesCodes
Codes
Narayan Loke
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
Vishnu
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
SanthanaMari11
 
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, NepalArduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
bishal bhattarai
 
Metal detecting robot sketch
Metal detecting robot sketchMetal detecting robot sketch
Metal detecting robot sketch
Akhil Unnikrishnan
 
Lampiran 1.programdocx
Lampiran 1.programdocxLampiran 1.programdocx
Lampiran 1.programdocx
Lugik kristiyanto
 
coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino
Nanda Fauzi P
 
The MHV Board
The MHV BoardThe MHV Board
The MHV Board
AlastairDSilva
 
IoTA Unit 3.pptx programming and interfaces sensor
IoTA Unit 3.pptx programming and interfaces sensorIoTA Unit 3.pptx programming and interfaces sensor
IoTA Unit 3.pptx programming and interfaces sensor
Harini737456
 
INT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdfINT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdf
MSingh88
 
Introduction to Arduino and Circuits
Introduction to Arduino and CircuitsIntroduction to Arduino and Circuits
Introduction to Arduino and Circuits
Jason Griffey
 
Sensors and Actuators in Arduino, Introduction
Sensors and Actuators in Arduino, IntroductionSensors and Actuators in Arduino, Introduction
Sensors and Actuators in Arduino, Introduction
BibekPokhrel13
 
Wireless humidity and temperature monitoring system
Wireless humidity and temperature monitoring systemWireless humidity and temperature monitoring system
Wireless humidity and temperature monitoring system
Sagar Srivastav
 
[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노
Chiwon Song
 
Musical Machines and Flapping Phones
Musical Machines and Flapping PhonesMusical Machines and Flapping Phones
Musical Machines and Flapping Phones
Neil Mendoza
 
A Wireless Application of The Rain, Humidity and Temperature Sensors Based on...
A Wireless Application of The Rain, Humidity and Temperature Sensors Based on...A Wireless Application of The Rain, Humidity and Temperature Sensors Based on...
A Wireless Application of The Rain, Humidity and Temperature Sensors Based on...
政德 劉
 
Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.
Ankita Tiwari
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
Vishnu
 
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, NepalArduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
bishal bhattarai
 
coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino
Nanda Fauzi P
 
Ad

Recently uploaded (20)

Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSELET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
OlgaLeonorTorresSnch
 
Exploring Identity Through Colombian Companies
Exploring Identity Through Colombian CompaniesExploring Identity Through Colombian Companies
Exploring Identity Through Colombian Companies
OlgaLeonorTorresSnch
 
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdfপ্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
Pragya - UEM Kolkata Quiz Club
 
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdfForestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
ChalaKelbessa
 
Order: Odonata Isoptera and Thysanoptera.pptx
Order: Odonata Isoptera and Thysanoptera.pptxOrder: Odonata Isoptera and Thysanoptera.pptx
Order: Odonata Isoptera and Thysanoptera.pptx
Arshad Shaikh
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
How to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guidesHow to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guides
Celine George
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
muneebrana3215
 
How to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time OffHow to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time Off
Celine George
 
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGYHUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
DHARMENDRA SAHU
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
Uterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managmentUterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managment
Ritu480198
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx
Arshad Shaikh
 
Critical Thinking and Bias with Jibi Moses
Critical Thinking and Bias with Jibi MosesCritical Thinking and Bias with Jibi Moses
Critical Thinking and Bias with Jibi Moses
Excellence Foundation for South Sudan
 
LDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-inLDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-in
LDM & Mia eStudios
 
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
wygalkelceqg
 
Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSELET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
OlgaLeonorTorresSnch
 
Exploring Identity Through Colombian Companies
Exploring Identity Through Colombian CompaniesExploring Identity Through Colombian Companies
Exploring Identity Through Colombian Companies
OlgaLeonorTorresSnch
 
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdfপ্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
Pragya - UEM Kolkata Quiz Club
 
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdfForestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
ChalaKelbessa
 
Order: Odonata Isoptera and Thysanoptera.pptx
Order: Odonata Isoptera and Thysanoptera.pptxOrder: Odonata Isoptera and Thysanoptera.pptx
Order: Odonata Isoptera and Thysanoptera.pptx
Arshad Shaikh
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
How to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guidesHow to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guides
Celine George
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
muneebrana3215
 
How to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time OffHow to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time Off
Celine George
 
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGYHUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
DHARMENDRA SAHU
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
Uterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managmentUterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managment
Ritu480198
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx
Arshad Shaikh
 
LDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-inLDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-in
LDM & Mia eStudios
 
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
wygalkelceqg
 
Ad

Arduino Code

  • 1. void setup(){ Serial.begin(9600); pinMode(A0, INPUT); } void loop() { val = analogRead(A0); float mv = (val/1024) *5000; float cel = mv/10; float far = (cel*9)/5 + 32; Serial.print("TEMPERATURE = "); Serial.print(cel); Serial.print(" degree Celsius or "); Serial.print(far); Serial.print(" degree Fahrenheit"); Serial.println(); delay(1000); }
  • 2. #include<dht.h> dht DHT; void setup () { Serial.begin(9600); pinMode(A0,INPUT); } void loop () { DHT.read11(A0); Serial.print(“ Humidity = “); Serial.print(DHT.humidity); Serial.print(“%t”); Serial.print(“ Temperature = “); Serial.print(DHT.temperature); Serial.println(); delay(5000); }
  • 3. #include<Servo.h> Servomyservo; intpotpin=0; int val; void setup() { myservo.attach(9); } void loop() { val = analogRead(potpin); val = map(val,0,1023,0,180); myservo.write(val); delay(10); }
  • 4. #include <Stepper.h> // Include the header file // change this to the number of steps on your motor #define STEPS 32 // create an instance of the stepper class using the steps and pins Stepper stepper(STEPS,8,10, 9, 11); int Pval = 0; int potVal = 0; void setup() { Serial.begin(9600); stepper.setSpeed(200); } void loop() { potVal = analogRead(A0); potVal = map(potVal,0,1024,0,500); if (potVal>Pval) stepper.step(5); if (potVal<Pval) stepper.step(-5); Pval = potVal; }
  • 5. int motorpin1 = 6; int motorpin2 = 7; void setup () { pinMode(motorpin1, OUTPUT); pinMode(motorpin2, OUTPUT); } void loop () { digitalWrite(motorpin1, LOW); digitalWrite(motorpin2, HIGH); }
  • 6. int sensorPin =A0; int sensorValue =0; void setup () { Serial.begin(9600); } void loop () { sensorValue = analogRead(sensorPin); Serial.println(sensorValue); delay(1000); }