SlideShare a Scribd company logo
1 of 15
NodeMCU
Programming
Session: 2
Topics covered in this session:
1. Prerequisites
2. Resources
3. Arduino IDE Installation
4. Introduction to NodeMCU hardware and Arduino IDE -
Program Structure and how LEDs work?
5. Blink Code.
6. DIY using Simulation!!!
1.1 Prerequisites
● Basic Programming knowledge. (C, C++, etc)
● Understanding of Electronics. (Basic Electronics)
2 Resources Needed:
● Integrated Development Environment installed. (Arduino IDE)
● 1 NodeMCU ESP8266 WiFi microcontroller
● 1 Breadboard, 1 LED & Resistor for LED, Few jumper wires
● 1 Micro-USB cable
● A Laptop
Arduino IDE Installation
1. Install the Arduino IDE from https://www.arduino.cc/en/Main/Software
Install the IDE and the drivers that come with it.
MAC: Install also these drivers https://www.silabs.com/products/development-
tools/software/usb-to-uart-bridge-vcp-drivers
2. Open Arduino IDE and add the board manager link to the preferences.
Open “Preferences” menu in File -> Preferences
Check the boxes in the preferences according to the picture in the next slide for a
better development interface.
Also, add the link
http://arduino.esp8266.com/stable/package_esp8266com_index.json to
“Additional Boards Manager URLs” and save settings by pressing OK.
3. Install the new board manager for ESP8266 chip
In the Arduino IDE Go to Tools -> Board (…) -> Boards manager…
Search for “ESP8266”, click the suggested result and press install.
4. Confirm the installation and choose the NodeMCU board for the current
board
Go to Tools -> Board (…) and select “NodeMCU 1.0 (ESP 12-E module)” from
the list.
DONE WITH THE CONFIGURATION!
Programming the NodeMCU Using Arduino IDE:
● Arduino IDE - Text editing program
● Sketch (Code File) > High Level Language > Compile > Machine
Language
● IDE - Translates and Compiles the code - Understand by NodeMCU
● Mistakes/ Errors?
● The serial monitor - interacting - using the computer - real-time
monitoring and analysing.
Introduction to hardware and Arduino IDE -
Program Structure & How LEDs work?
● Each arduino program has two mandatory functions: setup() and loop().
● The code inside the setup() function is executed once .
● The loop() function is run constantly while the microcontroller is powered.
Basic operation of an arduino program:
A function is a group of statements that together perform a
task.
Commands in setup() function:
● Declaring pins:
Variables
const int LED = 4;
// NOTE! You can use either 4 or D2 value for the same pin.
● Defining the type of the pin, or the pin mode:
pinMode(pin, mode); // e.g. pinMode(LED, OUTPUT);
● Modes:
INPUT // e.g. buttons, switches, keyboards, etc.
OUTPUT // e.g. LEDs, screens, etc.
Commands in loop() function:
● Digital pins:
digitalWrite(pin, value); // values are used to activate the pin.
digitalRead(pin);
● Values:
value - LOW // Off
value - HIGH // On
Breadboard:
NodeMCU Hardware:
LED:
TinkerCAD
● Free online collection of software tools.
● Design basic circuits and also simulate them including Arduino.
● Easy-to-use app for 3D design, electronics, and coding.
● www.tinkercad.com

More Related Content

What's hot

Week2 fundamental of IoT
Week2 fundamental of IoTWeek2 fundamental of IoT
Week2 fundamental of IoTsomphongt
 
Home automation using IoT and AWS Cloud technology
Home automation using IoT and AWS Cloud technologyHome automation using IoT and AWS Cloud technology
Home automation using IoT and AWS Cloud technologyratthaslip ranokphanuwat
 
IOT Based Home Automation using Raspberry Pi-3
IOT Based Home Automation using Raspberry Pi-3IOT Based Home Automation using Raspberry Pi-3
IOT Based Home Automation using Raspberry Pi-3Mohammad Qasim Malik
 
Presentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUPresentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUSouvik Kundu
 
Attendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQLAttendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQLSanjay Kumar
 
Introduction to Smart Devices
Introduction to Smart DevicesIntroduction to Smart Devices
Introduction to Smart DevicesYong Heui Cho
 
Internet of Things (IoT) Based Smart Security & Home Automation System.
Internet of Things (IoT) Based Smart Security & Home Automation System.Internet of Things (IoT) Based Smart Security & Home Automation System.
Internet of Things (IoT) Based Smart Security & Home Automation System.sayed78
 
IoT Based home automation system using Arduino board
IoT Based home automation system using Arduino boardIoT Based home automation system using Arduino board
IoT Based home automation system using Arduino boardIRJET Journal
 
Home Automation Over Internet Project (Ev Otomasyon Projesi)
Home Automation Over Internet Project (Ev Otomasyon Projesi)Home Automation Over Internet Project (Ev Otomasyon Projesi)
Home Automation Over Internet Project (Ev Otomasyon Projesi)Birol Arslan
 
Arduino interfacing with bluetooth.
Arduino interfacing with bluetooth.Arduino interfacing with bluetooth.
Arduino interfacing with bluetooth.Nitish Kumar
 
Eckovation IoT internship Report PowerPoint presentation
Eckovation IoT internship Report PowerPoint presentationEckovation IoT internship Report PowerPoint presentation
Eckovation IoT internship Report PowerPoint presentationManoranjanMaharana7
 
SMART INTELLIGENT SECURITY SYSTEM FOR WOMEN
SMART INTELLIGENT SECURITY SYSTEM FOR WOMENSMART INTELLIGENT SECURITY SYSTEM FOR WOMEN
SMART INTELLIGENT SECURITY SYSTEM FOR WOMENIAEME Publication
 
Applications of various latest coprocessors
Applications of various latest coprocessorsApplications of various latest coprocessors
Applications of various latest coprocessorsSejal Anand
 
CEIS101: IoT Home Security System
CEIS101: IoT Home Security SystemCEIS101: IoT Home Security System
CEIS101: IoT Home Security SystemBillBlanco
 
Smart door lock
Smart door lockSmart door lock
Smart door lockaswin5432
 
Introduction to IoT Network
Introduction to IoT NetworkIntroduction to IoT Network
Introduction to IoT NetworkYong Heui Cho
 

What's hot (20)

Week2 fundamental of IoT
Week2 fundamental of IoTWeek2 fundamental of IoT
Week2 fundamental of IoT
 
Embedded Systems and IoT
Embedded Systems and IoTEmbedded Systems and IoT
Embedded Systems and IoT
 
Home automation using IoT and AWS Cloud technology
Home automation using IoT and AWS Cloud technologyHome automation using IoT and AWS Cloud technology
Home automation using IoT and AWS Cloud technology
 
IOT Based Home Automation using Raspberry Pi-3
IOT Based Home Automation using Raspberry Pi-3IOT Based Home Automation using Raspberry Pi-3
IOT Based Home Automation using Raspberry Pi-3
 
Presentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUPresentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCU
 
Attendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQLAttendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQL
 
Introduction to Smart Devices
Introduction to Smart DevicesIntroduction to Smart Devices
Introduction to Smart Devices
 
Internet of Things (IoT) Based Smart Security & Home Automation System.
Internet of Things (IoT) Based Smart Security & Home Automation System.Internet of Things (IoT) Based Smart Security & Home Automation System.
Internet of Things (IoT) Based Smart Security & Home Automation System.
 
IoT Based home automation system using Arduino board
IoT Based home automation system using Arduino boardIoT Based home automation system using Arduino board
IoT Based home automation system using Arduino board
 
Home Automation Over Internet Project (Ev Otomasyon Projesi)
Home Automation Over Internet Project (Ev Otomasyon Projesi)Home Automation Over Internet Project (Ev Otomasyon Projesi)
Home Automation Over Internet Project (Ev Otomasyon Projesi)
 
Arduino interfacing with bluetooth.
Arduino interfacing with bluetooth.Arduino interfacing with bluetooth.
Arduino interfacing with bluetooth.
 
smart automation system
smart automation systemsmart automation system
smart automation system
 
Iot based home automation
Iot based home automationIot based home automation
Iot based home automation
 
Eckovation IoT internship Report PowerPoint presentation
Eckovation IoT internship Report PowerPoint presentationEckovation IoT internship Report PowerPoint presentation
Eckovation IoT internship Report PowerPoint presentation
 
SMART INTELLIGENT SECURITY SYSTEM FOR WOMEN
SMART INTELLIGENT SECURITY SYSTEM FOR WOMENSMART INTELLIGENT SECURITY SYSTEM FOR WOMEN
SMART INTELLIGENT SECURITY SYSTEM FOR WOMEN
 
IOT PPT
IOT PPTIOT PPT
IOT PPT
 
Applications of various latest coprocessors
Applications of various latest coprocessorsApplications of various latest coprocessors
Applications of various latest coprocessors
 
CEIS101: IoT Home Security System
CEIS101: IoT Home Security SystemCEIS101: IoT Home Security System
CEIS101: IoT Home Security System
 
Smart door lock
Smart door lockSmart door lock
Smart door lock
 
Introduction to IoT Network
Introduction to IoT NetworkIntroduction to IoT Network
Introduction to IoT Network
 

Similar to Getting Started with the NodeMCU- NodeMCU Programming (By Akshet Patel)

Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docxAjay578679
 
IOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdfIOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdfMayuRana1
 
Embedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptxEmbedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptxaartis110
 
Embedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontrollerEmbedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontrollerArun Kumar
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoDamien Magoni
 
arduino-esp32-projects.pdf
arduino-esp32-projects.pdfarduino-esp32-projects.pdf
arduino-esp32-projects.pdfDaniel Donatelli
 
Introduction to Arduino.pptx
Introduction to Arduino.pptxIntroduction to Arduino.pptx
Introduction to Arduino.pptxAkshat Bijronia
 
Up and running with Arduino
Up and running with Arduino Up and running with Arduino
Up and running with Arduino KUET
 
esp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdfesp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdfDaniel Donatelli
 
wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3hari prasad
 
Weather monitoring System Using STM32
Weather monitoring System Using STM32Weather monitoring System Using STM32
Weather monitoring System Using STM32Hitesh Kumar Nath
 
Arduino Development For Beginners
Arduino Development For BeginnersArduino Development For Beginners
Arduino Development For BeginnersFTS seminar
 
Rdl esp32 development board trainer kit
Rdl esp32 development board trainer kitRdl esp32 development board trainer kit
Rdl esp32 development board trainer kitResearch Design Lab
 

Similar to Getting Started with the NodeMCU- NodeMCU Programming (By Akshet Patel) (20)

An introduction to Arduino
An introduction to ArduinoAn introduction to Arduino
An introduction to Arduino
 
Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docx
 
IOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdfIOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdf
 
Embedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptxEmbedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptx
 
Embedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontrollerEmbedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontroller
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Aurdino presentation
Aurdino presentationAurdino presentation
Aurdino presentation
 
arduino-esp32-projects.pdf
arduino-esp32-projects.pdfarduino-esp32-projects.pdf
arduino-esp32-projects.pdf
 
Introduction to Arduino.pptx
Introduction to Arduino.pptxIntroduction to Arduino.pptx
Introduction to Arduino.pptx
 
Up and running with Arduino
Up and running with Arduino Up and running with Arduino
Up and running with Arduino
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
 
esp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdfesp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdf
 
wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3wireless charging of an electrical vechicle 3
wireless charging of an electrical vechicle 3
 
Indroduction arduino
Indroduction arduinoIndroduction arduino
Indroduction arduino
 
Indroduction the arduino
Indroduction the arduinoIndroduction the arduino
Indroduction the arduino
 
Arduino
ArduinoArduino
Arduino
 
Weather monitoring System Using STM32
Weather monitoring System Using STM32Weather monitoring System Using STM32
Weather monitoring System Using STM32
 
Arduino Development For Beginners
Arduino Development For BeginnersArduino Development For Beginners
Arduino Development For Beginners
 
arduinoedit.pptx
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptx
 
Rdl esp32 development board trainer kit
Rdl esp32 development board trainer kitRdl esp32 development board trainer kit
Rdl esp32 development board trainer kit
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

Getting Started with the NodeMCU- NodeMCU Programming (By Akshet Patel)

  • 2. Topics covered in this session: 1. Prerequisites 2. Resources 3. Arduino IDE Installation 4. Introduction to NodeMCU hardware and Arduino IDE - Program Structure and how LEDs work? 5. Blink Code. 6. DIY using Simulation!!!
  • 3. 1.1 Prerequisites ● Basic Programming knowledge. (C, C++, etc) ● Understanding of Electronics. (Basic Electronics) 2 Resources Needed: ● Integrated Development Environment installed. (Arduino IDE) ● 1 NodeMCU ESP8266 WiFi microcontroller ● 1 Breadboard, 1 LED & Resistor for LED, Few jumper wires ● 1 Micro-USB cable ● A Laptop
  • 4. Arduino IDE Installation 1. Install the Arduino IDE from https://www.arduino.cc/en/Main/Software Install the IDE and the drivers that come with it. MAC: Install also these drivers https://www.silabs.com/products/development- tools/software/usb-to-uart-bridge-vcp-drivers 2. Open Arduino IDE and add the board manager link to the preferences. Open “Preferences” menu in File -> Preferences Check the boxes in the preferences according to the picture in the next slide for a better development interface. Also, add the link http://arduino.esp8266.com/stable/package_esp8266com_index.json to “Additional Boards Manager URLs” and save settings by pressing OK.
  • 5.
  • 6. 3. Install the new board manager for ESP8266 chip In the Arduino IDE Go to Tools -> Board (…) -> Boards manager… Search for “ESP8266”, click the suggested result and press install. 4. Confirm the installation and choose the NodeMCU board for the current board Go to Tools -> Board (…) and select “NodeMCU 1.0 (ESP 12-E module)” from the list. DONE WITH THE CONFIGURATION!
  • 7. Programming the NodeMCU Using Arduino IDE: ● Arduino IDE - Text editing program ● Sketch (Code File) > High Level Language > Compile > Machine Language ● IDE - Translates and Compiles the code - Understand by NodeMCU ● Mistakes/ Errors? ● The serial monitor - interacting - using the computer - real-time monitoring and analysing.
  • 8. Introduction to hardware and Arduino IDE - Program Structure & How LEDs work? ● Each arduino program has two mandatory functions: setup() and loop(). ● The code inside the setup() function is executed once . ● The loop() function is run constantly while the microcontroller is powered.
  • 9. Basic operation of an arduino program: A function is a group of statements that together perform a task.
  • 10. Commands in setup() function: ● Declaring pins: Variables const int LED = 4; // NOTE! You can use either 4 or D2 value for the same pin. ● Defining the type of the pin, or the pin mode: pinMode(pin, mode); // e.g. pinMode(LED, OUTPUT); ● Modes: INPUT // e.g. buttons, switches, keyboards, etc. OUTPUT // e.g. LEDs, screens, etc.
  • 11. Commands in loop() function: ● Digital pins: digitalWrite(pin, value); // values are used to activate the pin. digitalRead(pin); ● Values: value - LOW // Off value - HIGH // On
  • 14. LED:
  • 15. TinkerCAD ● Free online collection of software tools. ● Design basic circuits and also simulate them including Arduino. ● Easy-to-use app for 3D design, electronics, and coding. ● www.tinkercad.com