Archives

8051 Interface – LED

 This tutorial you can learn hello wold LED Blinking project in keil for micro controller. choosed AT89S51 micro controller(You can select any other keil support micro controller) and demonstrated, this is very simple and follow this below steps,
Light Emitting Diodes (LEDs) are simple and most commonly used electronic components to display the digital signal states. The LED emits light when current is passed through it. It could blow up if we pass more current, hence we put a current limiting resistor. Usually, 220, 470 and 1K ohm resistors are commonly used as limiting resistors. You can use any of these depending on the required brightness. Lets, start blinking with LEDs and then generate the different patterns using the available LEDs.
The basic and important feature of any controllers is the number of GPIO’s available for connecting the peripherals. 8051 has 32-gpio’s grouped into 4-Ports namely P0-P3

Required software

 

Required components and Programmer

  • 1x AT89S51 Controller
  • 1x 4Mhz Crystal
  • 2x 22pf capacitor
  • 1x LED 5v
  • ISP AVR USB programmer

 

Circuit Diagram

 C code

 

Assembly Code

 



 

 

ESP8266 Mongoose-OS Interface – LED

To turn on the led you need to load the gpio_api.js file.


LED Turn ON/OFF

Note : This below example was tested mongoose os with java script app demo-js in ESP8266 NodeMCU Dev Board(ESP-12E)

  • This below example turn on the LED GPIO-4 (NodeMCU Dev Board digital pin 2)
  • Set the GPIO pin mode as OUPUT uisng gpio set mode function ex: GPIO.set_mode(led, GPIO.MODE_OUTPUT)
  • Turn off the LED call the gpio write function with low-0 ex : GPIO.write(led, 0) .
  • Turn on the LED call the gpio write function with low-1 ex : GPIO.write(led, 1) .

Code

 


LED turn ON/OFF using button

  • Use Boot button(GPIO-0)
  • The example code used blink in-build LED, It’s connected to GPIO-10.
  • You can change any other pin Ex : led = 4; // Get LED GPIO-04 pin; 
  • Note : Code 1 and Two are same application and functionality. Main difference is calling function.

Code 1 :

  • Used GPIO-0 pin (Boot button in NodeMCU Dev Board), as interrupt and used Button interrupt handler function.

 

Code 2:

  • In this code i was used GPIO-0 pin (Boot button in NodeMCU dev Kit) as interrupt and used interrupt handler function.
  • If your using interruot handler function then you need o enable the interrupt using GPIO.enable_int(pin) function


 

ESP8266 Arduino-Core Interface – LED

 

ESP8266 Arduino Blink In-Build Blue LED

 

 

    ESP8266 module have a inbuilt Blue LED. We can blink that blue LED very simple program. if you are beginner you can learn start from this tutorial like Hello world program. its very simple. Blue LED is connected to  GPIO-10 pin, so we set gpio-10 as a output and blink code using Arduino core.
  • Required Hardware Components are 1x ESP8266 Any Module( Used Ai-Thingers ESP-12F), ESP8266 Programmer (FDTI chip or use your Arduino board)    – 1
  • Required Software and Tools is Arduino IDE with ESP8266 Core

Code


ESP8266 Arduino LED-Fade

  • Required Hardware and ESP8266 with Programmer (or) NodeMCU Dev Kit
  • Required Software Tools are Arduino IDE with ESP8266 Core

Code


ESP8266 Arduino LED Blink Without Delay function

Code

 


 

if you have any queries call us +918300026060 or WhatsApp Dismiss

0

Your Cart

%d bloggers like this: