SlideShare ist ein Scribd-Unternehmen logo
1 von 6
Downloaden Sie, um offline zu lesen
1 | S y e d A b u z a r
Arduino Coding for Transformer interfacing:
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600); // baud rate
Serial.flush();
}
// the loop function runs over and over again forever
void loop() {
int LED_BUILTINState = digitalRead(LED_BUILTIN);
int loopcount=0;
while (Serial.available() > 0 )
{
input += (char) Serial.read(); // Read in one char at a time
delay(5); // Delay for 5 ms so the next char has time to be received
}
long starttime = millis();
long endtime = starttime;
if (input == "on" )
{
digitalWrite(LED_BUILTIN, HIGH); // on
2 | S y e d A b u z a r
Serial.println(" Power on");
}
if(input == "off")
{
digitalWrite(LED_BUILTIN, LOW); // off
Serial.println(" Power off");
}
while (input == "0.5" && (endtime - starttime) <=5000)
{
digitalWrite(LED_BUILTIN, HIGH); // on
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
loopcount = loopcount+1;
Serial.print(loopcount );
Serial.println(" f=0.5Hz");
endtime = millis();
}
while (input == "1" && (endtime - starttime) <=5000)
{
3 | S y e d A b u z a r
digitalWrite(LED_BUILTIN, HIGH); // on
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
loopcount = loopcount+1;
Serial.print(loopcount );
Serial.println(" f=1Hz");
endtime = millis();
}
while (input == "5" && (endtime - starttime) <=5000)
{
digitalWrite(LED_BUILTIN, HIGH); // on
delay(100);
digitalWrite(LED_BUILTIN, LOW);
delay(100);
loopcount = loopcount+1;
Serial.print(loopcount );
Serial.println(" f=5Hz");
endtime = millis();
}
while (input == "10" && (endtime - starttime) <=5000)
{
digitalWrite(LED_BUILTIN, HIGH); // on
4 | S y e d A b u z a r
delay(50);
digitalWrite(LED_BUILTIN, LOW);
delay(50);
loopcount = loopcount+1;
Serial.print(loopcount );
Serial.println(" f=10Hz");
endtime = millis();
}
while (input == "20" && (endtime - starttime) <=5000)
{
digitalWrite(LED_BUILTIN, HIGH); // on
delay(25);
digitalWrite(LED_BUILTIN, LOW);
delay(25);
loopcount = loopcount+1;
Serial.print(loopcount );
Serial.println(" f=20Hz");
endtime = millis();
}
while (input == "30" && (endtime - starttime) <=5000)
{
digitalWrite(LED_BUILTIN, HIGH); // on
delay(16.67);
5 | S y e d A b u z a r
digitalWrite(LED_BUILTIN, LOW);
delay(16.7);
loopcount = loopcount+1;
Serial.print(loopcount );
Serial.println(" f=30Hz");
endtime = millis();
}
while (input == "40" && (endtime - starttime) <=5000)
{
digitalWrite(LED_BUILTIN, HIGH); // on
delay(12.5);
digitalWrite(LED_BUILTIN, LOW);
delay(12.5);
loopcount = loopcount+1;
Serial.print(loopcount );
Serial.println(" f=40Hz");
endtime = millis();
}
while (input == "50" && (endtime - starttime) <=5000)
{
digitalWrite(LED_BUILTIN, HIGH); // on
6 | S y e d A b u z a r
delay(10);
digitalWrite(LED_BUILTIN, LOW);
delay(10);
loopcount = loopcount+1;
Serial.print(loopcount );
Serial.println(" f=50Hz");
endtime = millis();
}
while (input == "60" && (endtime - starttime) <=5000)
{
digitalWrite(LED_BUILTIN, HIGH); // on
delay(8.4);
digitalWrite(LED_BUILTIN, LOW);
delay(8.4);
loopcount = loopcount+1;
Serial.print(loopcount );
Serial.println(" f=60Hz");
endtime = millis();
}
}

Weitere ähnliche Inhalte

Was ist angesagt?

Mao arduino
Mao arduinoMao arduino
Mao arduino
Mao Wu
 
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Hsien-Hsin Sean Lee, Ph.D.
 

Was ist angesagt? (20)

VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
Assignment#5
Assignment#5Assignment#5
Assignment#5
 
Led program
Led programLed program
Led program
 
Assignment#3a
Assignment#3aAssignment#3a
Assignment#3a
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and Encoder
 
Mao arduino
Mao arduinoMao arduino
Mao arduino
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
 
Fpga creating counter with external clock
Fpga   creating counter with external clockFpga   creating counter with external clock
Fpga creating counter with external clock
 
Micro Assignment 1
Micro Assignment 1Micro Assignment 1
Micro Assignment 1
 
REPORT
REPORTREPORT
REPORT
 
Nand or gates ver_student
Nand or gates ver_studentNand or gates ver_student
Nand or gates ver_student
 
Electronics lec 10
Electronics lec 10Electronics lec 10
Electronics lec 10
 
Assignment#1b
Assignment#1bAssignment#1b
Assignment#1b
 
Code2
Code2Code2
Code2
 
Assignment#6
Assignment#6Assignment#6
Assignment#6
 
Assignment#4b
Assignment#4bAssignment#4b
Assignment#4b
 
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
 
Up and running with Teensy 3.1
Up and running with Teensy 3.1Up and running with Teensy 3.1
Up and running with Teensy 3.1
 
Easy GPS Tracker using Arduino and Python
Easy GPS Tracker using Arduino and PythonEasy GPS Tracker using Arduino and Python
Easy GPS Tracker using Arduino and Python
 
Task i
Task iTask i
Task i
 

Ähnlich wie Aurduino coding for transformer interfacing

PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller
Swapnil2515
 
Arduino: Analog I/O
Arduino: Analog I/OArduino: Analog I/O
Arduino: Analog I/O
June-Hao Hou
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdf
forwardcom41
 
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Irfan Qadoos
 
robotics presentation for a club you run
robotics presentation for a club you runrobotics presentation for a club you run
robotics presentation for a club you run
SunilAcharya37
 
Mims effect
Mims effectMims effect
Mims effect
arnaullb
 
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
 GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
alltiusind
 

Ähnlich wie Aurduino coding for transformer interfacing (20)

Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016
 
Arduino Programming
Arduino ProgrammingArduino Programming
Arduino Programming
 
PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller
 
Pwm wave
Pwm wave Pwm wave
Pwm wave
 
Scottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RADScottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RAD
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuators
 
Arduino: Analog I/O
Arduino: Analog I/OArduino: Analog I/O
Arduino: Analog I/O
 
Metal detecting robot sketch
Metal detecting robot sketchMetal detecting robot sketch
Metal detecting robot sketch
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controller
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdf
 
Arduino coding class part ii
Arduino coding class part iiArduino coding class part ii
Arduino coding class part ii
 
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
 
robotics presentation for a club you run
robotics presentation for a club you runrobotics presentation for a club you run
robotics presentation for a club you run
 
Mims effect
Mims effectMims effect
Mims effect
 
Open bot
Open bot Open bot
Open bot
 
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
 GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
 
FINISHED_CODE
FINISHED_CODEFINISHED_CODE
FINISHED_CODE
 
Musical Machines and Flapping Phones
Musical Machines and Flapping PhonesMusical Machines and Flapping Phones
Musical Machines and Flapping Phones
 
OpenBot-Code
OpenBot-CodeOpenBot-Code
OpenBot-Code
 

Mehr von COMSATS Abbottabad

Mehr von COMSATS Abbottabad (20)

Kalman filter
Kalman filterKalman filter
Kalman filter
 
Enterpreneurship
EnterpreneurshipEnterpreneurship
Enterpreneurship
 
Sine wave inverter
Sine wave inverterSine wave inverter
Sine wave inverter
 
Light Tracking Solar Panel
Light Tracking Solar PanelLight Tracking Solar Panel
Light Tracking Solar Panel
 
Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical System
 
coding and burning program in FPGA
coding and burning program in FPGAcoding and burning program in FPGA
coding and burning program in FPGA
 
8 bit full adder
8 bit full adder8 bit full adder
8 bit full adder
 
Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)
 
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
 
implementation of data instrucions in emu8086
implementation of data instrucions in emu8086implementation of data instrucions in emu8086
implementation of data instrucions in emu8086
 
Addition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly languageAddition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly language
 
Mathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in MatlabMathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in Matlab
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
 
Introduction to MATLAB
Introduction to MATLAB Introduction to MATLAB
Introduction to MATLAB
 
Encoder + decoder
Encoder + decoderEncoder + decoder
Encoder + decoder
 
Principles of Communication
Principles of CommunicationPrinciples of Communication
Principles of Communication
 
Transformer Interfacing with Laptop
Transformer Interfacing with LaptopTransformer Interfacing with Laptop
Transformer Interfacing with Laptop
 
Temperature control Switch and Display By Led
Temperature control Switch and Display By LedTemperature control Switch and Display By Led
Temperature control Switch and Display By Led
 
stress and strain
stress and strainstress and strain
stress and strain
 
Generating PM wave
Generating PM wave Generating PM wave
Generating PM wave
 

Kürzlich hochgeladen

VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 

Kürzlich hochgeladen (20)

Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 

Aurduino coding for transformer interfacing

  • 1. 1 | S y e d A b u z a r Arduino Coding for Transformer interfacing: void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_BUILTIN, OUTPUT); Serial.begin(9600); // baud rate Serial.flush(); } // the loop function runs over and over again forever void loop() { int LED_BUILTINState = digitalRead(LED_BUILTIN); int loopcount=0; while (Serial.available() > 0 ) { input += (char) Serial.read(); // Read in one char at a time delay(5); // Delay for 5 ms so the next char has time to be received } long starttime = millis(); long endtime = starttime; if (input == "on" ) { digitalWrite(LED_BUILTIN, HIGH); // on
  • 2. 2 | S y e d A b u z a r Serial.println(" Power on"); } if(input == "off") { digitalWrite(LED_BUILTIN, LOW); // off Serial.println(" Power off"); } while (input == "0.5" && (endtime - starttime) <=5000) { digitalWrite(LED_BUILTIN, HIGH); // on delay(1000); digitalWrite(LED_BUILTIN, LOW); delay(1000); loopcount = loopcount+1; Serial.print(loopcount ); Serial.println(" f=0.5Hz"); endtime = millis(); } while (input == "1" && (endtime - starttime) <=5000) {
  • 3. 3 | S y e d A b u z a r digitalWrite(LED_BUILTIN, HIGH); // on delay(500); digitalWrite(LED_BUILTIN, LOW); delay(500); loopcount = loopcount+1; Serial.print(loopcount ); Serial.println(" f=1Hz"); endtime = millis(); } while (input == "5" && (endtime - starttime) <=5000) { digitalWrite(LED_BUILTIN, HIGH); // on delay(100); digitalWrite(LED_BUILTIN, LOW); delay(100); loopcount = loopcount+1; Serial.print(loopcount ); Serial.println(" f=5Hz"); endtime = millis(); } while (input == "10" && (endtime - starttime) <=5000) { digitalWrite(LED_BUILTIN, HIGH); // on
  • 4. 4 | S y e d A b u z a r delay(50); digitalWrite(LED_BUILTIN, LOW); delay(50); loopcount = loopcount+1; Serial.print(loopcount ); Serial.println(" f=10Hz"); endtime = millis(); } while (input == "20" && (endtime - starttime) <=5000) { digitalWrite(LED_BUILTIN, HIGH); // on delay(25); digitalWrite(LED_BUILTIN, LOW); delay(25); loopcount = loopcount+1; Serial.print(loopcount ); Serial.println(" f=20Hz"); endtime = millis(); } while (input == "30" && (endtime - starttime) <=5000) { digitalWrite(LED_BUILTIN, HIGH); // on delay(16.67);
  • 5. 5 | S y e d A b u z a r digitalWrite(LED_BUILTIN, LOW); delay(16.7); loopcount = loopcount+1; Serial.print(loopcount ); Serial.println(" f=30Hz"); endtime = millis(); } while (input == "40" && (endtime - starttime) <=5000) { digitalWrite(LED_BUILTIN, HIGH); // on delay(12.5); digitalWrite(LED_BUILTIN, LOW); delay(12.5); loopcount = loopcount+1; Serial.print(loopcount ); Serial.println(" f=40Hz"); endtime = millis(); } while (input == "50" && (endtime - starttime) <=5000) { digitalWrite(LED_BUILTIN, HIGH); // on
  • 6. 6 | S y e d A b u z a r delay(10); digitalWrite(LED_BUILTIN, LOW); delay(10); loopcount = loopcount+1; Serial.print(loopcount ); Serial.println(" f=50Hz"); endtime = millis(); } while (input == "60" && (endtime - starttime) <=5000) { digitalWrite(LED_BUILTIN, HIGH); // on delay(8.4); digitalWrite(LED_BUILTIN, LOW); delay(8.4); loopcount = loopcount+1; Serial.print(loopcount ); Serial.println(" f=60Hz"); endtime = millis(); } }