Introduction to LabVIEW

Hello everyone. I hope you all will be absolutely fine. Today, I am going to share an Introduction to LabView. LabView is a really exciting software and recently I have worked on many LabView Project so I thought to start this new set of series in which I am gonna explain all about LabView from beginners level to Pro Level. So, today I am gonna upload the first tutorial in this LabVIEW series so that's why I have named it Introduction to LabView and I hope you are gonna like this tutorial. :)

LabVIEW basically stands for “Laboratory Virtual Instrument Engineering Workbench”. This software is designed by the National Instruments (NI) for the control and design of the projects. You can use it for simulation purposes, can also interface hardware with LabVIEW, data acquisition is another big benefit of LabView. Moreover we can also design automation and robotics projects in LabVIEW. Before designing such projects, let's first have a look at the Introduction to LabVIEW:

Introduction to LabVIEW

  • So, let's get started with Introduction to LabView and first of all what you need to do is to open the NI LabVIEW 2015 software.
  • A small window will open up as shown in the below figure:
  • So, this newly opened LabView window will have two portions “left bar” and “right bar”.
  • If you want to design new project then you have to click on the button “Create Project”.
  • If you want to open the project which already exists then press “Open Existing” button.
Opening New VI in LabView
  • Go to the “File” menu of the software as show in the figure below
  • Click on “New VI” or you can press the short code Ctrl+N. to open up new VI in LabView.
  • So, now when you click on this NewVI then you will see that two windows will open up.
  • One of them is known as “Front Panel” and second is known as “Block Diagram”.
  • Both windows and their functionalities are explained in detail below:
Block Diagram
  • Here is the screen shot of the “Block Diagram” so when we are having the Introduction to LabVIEW then we must discuss these windows in detail. :)
  • This window is named as Block Diagram because we design our LabVIEW Block Diagram in this window.
  • It's more of a back end programming section.
  • So suppose you are designing some simulation in LabView then what features you want in your simulation depends on your code in the Block Diagram.
Front Panel
  • Here's the screen shot of “Front Panel” of LabVIEW.
  • It's also known as GUI of LabVIEW.
  • In this Front Panel of LabView, we design the presentable output.
  • For example, you are working on some simulation and you have to display some sensors' values then they are gonna be displayed in this Front Panel.
So, both of these windows are equally important and works simultaneously with each other. So, if you change anything in Front Panel then its counter part in Block Diagram will also change. So, let's have a look at How to align these two windows in LabVIEW.
Windows Alignment in LabView
  • Now we know that if we are gonna work on some LabView simulation then we have to deal with two windows and in the above section of Introduction to LabView, we have discussed both of these windows.
  • Now the problem is when we are working on two windows simultaneously then we need both of them to be rite in front of us.
  • In order to do so, press “Ctrl+T” and both of your windows will be rite in front of you.
  • It will help you to align both the windows, the “Front Panel” and the “Block Diagram”.
  • The aligned windows are shown below and you can see the are looking nice comparatively.
  • If “Front Panel is there on you screen and “Block Diagram” window is not on the screen, then just pres “Ctrl+E”.
  • You can see “Block Diagram” also appears automatically on the screen.
  • You can perform it for the vice versa purpose as well.
Description of Block Diagram Window
  • Block diagram is a window in which we can create our logic by using different blocks.
  • NI LabVIEW basically supports Field Programmable Gate Array Language (FPGA).
  • We have to select different blocks according to the requirement ad they are known as FPGA blocks.
  • Press “Right Click” on the “Front Panel” a new “Function” tab opens as shown below:
  • From this “Function Tab” you can select different blocks to create your logic according to the requirements
  • The detail about few of the blocks and functions is given below.
Numeric Toolbox in LabVIEW
  • Go to the Functions-> Programming-> Numeric and you will get all your numeric tools there.
  • You can see, the following window on your screen
  • You can see different alphanumeric blocks (operators) like addition, subtraction etc. in the above figure
  • Using these operators you can perform different mathematical operations
Graphics in NI LabVIEW
  • Graphics tool is another amazing tool in this software and I think we should discuss them in this Introduction to LabView.
  • Go to Functions-> Programming-> Graphics & Sounds and you will get all your graphics tools in there.
  • You can see a window on your screen as shown below:
  • You can make three dimensional picture and plot three dimensional graphs as well.
Comparator in LabView
  • Go to Functions-> Programming-> Comparison and there's a big list of comparator waiting for you there.
  • You can see a window on the screen as shown below
  • These blocks are used for the comparison of two or more than two operators.
  • These blocks are used in the projects where there are some restrictions i.e. if temperature exceeds the threshold, fire alarm or buzzer turns into “ON” state then.
Loops in LabView
  • Go to Functions-> Programming-> Structures and here lie the most important functions of LabView programming.
  • The below window will appear on the screen:
 
  • If you want to run your created logic for different no of iterations, these loops will be helpful.
  • You have to just set the number of iterations and your program will according to the adjusted number of iterations.
Timing Toolbox in LabVIEW
  • Go to the Functions-> Programming-> Timing and you will find all the timing blocks in there.
  • You can see the following window on the screen:
 
  • If you want that your program should run with some delay.
  • These timing clock bocks will be helpful.
  • Usually their values are in milliseconds but you can adjust them accordingly by setting their properties.
Driver Support in NI LabVIEW
  • One of the amazing functions of the NI LabVIEW is that, it supports the external device drivers.
  • The device which we want to use and interface with the NI LabVIEW, we have to just install the driver of that device.
  • After the successful installation you can see that device in "Functions" Palette.
  • For example, go to the Functions-> Programming at the end of the window you can see the installed drivers or toolkits.
  • I have installed Arduino interface for NI LabVIEW 2015.
  • The figure below describes all of the above steps.
NI LabVIEW Supported Devices
Here's the list of most commonly used NI LabVIEW devices:
  1. compactRIO.
  2. myRIO (Re-configureable Input Output Device).
  3. sbRIO (Single Board Reconfigureable Input Output Device).
  4. Arduino.
  5. Raspberry PI.
  • NI LabVIEW suppors different devices.
  • You have to just install the drivers or toolkit of these devices.
  • After successful installation you will be able to use these devices.
Description of Front Panel
  • Press “Right Click” on the “Front Panel” window
  • You can see the output of your designed algorithm on the “Front Panel” window.
  • We can make our output’s look more and more beautiful.
  • For this purpose NI LabVIEW provides us with the “Decorations” section.
  • Go to the Controls-> Modern-> Decorations and the following window will be appeared on your screen.
 
  • These blocks are helpful while giving the better external look to the Front Panel.
  • Now go to the Controls-> Modern-> Boolean and you will have a look at the Boolean Buttons which are different in shapes and sizes.
  • You can see a new window on the screen as shown in below figure:
  • Round LED, Square LED are used for some indication purposes.
  • You can use a “Stop” button to terminate the program.
  • You can use radio buttons for “checking” and un-checking purposes.
Graphical Visual Display
  • Graphical Visual display is also a good function in NI LabVIEW.
  • You can display your output on different graphs.
  • Go to Controls-> Modern-> Graph and all the graphical Visual Displays open up.
  • The figure shown below will be appeared on the screen.
  • Select the graph you want and display your output on a particular graph.
  • 3D graphs is a very good option for the good looking output.
Searching Desired Blocks
  • Press “Right Click” in the front panel
  • Go to the “Search” option as shown in the figure below
  • Press the “Search” option
  • You can see following window on the screen
  • Type the name of the block you want to find.
  • Sometimes the “simple search” method takes a lot of time in finding the desired blocks.
  • So, I prefer to use the quick search method.
  • So, you should use “Quick Search” method, it will be helpful in time saving perspective.
  • Go to the “Front Panel” and press “Ctrl+Space Bar”.
  • You can see a new window on the screen.
  • You can see the window in the figure below.
  • For example, I want to search the “Simulate Signal” block.
  • So, I typed “Simulate Signal” in the search bar.
  • The desired blocks are appeared as shown in the figure below.
So, that's all form today's tutorial on Introduction to LabView. I hope that it will be helpful for all of you. I have tried my level best to share in detail, my knowledge on Introduction to LabVIEW, with all of guys. I'll share further knowledge about this software soon, till then take care :)

Eye Ball Detection in MATLAB

Buy This Project Hello friends, I hope you all are doing great. In today's tutorial, I am going to share Eye Ball Detection in MATLAB. I have designed this simulation in MATLAB and I have designed a GUI in which I am detection the Eye Balls from Images. Our team has worked quite hard in designing this project so we haven't shared the code for free. Instead we have placed a very small amount and you can buy it from our shop via PayPal. Click the above button in order to buy the project. If you are having any difficulty in buying this project then you can also ask in comments and we will surely help you out. Moreover, this algorithm has a small restriction that the person's eyes must be open in the image and his/her eye balls must be clearly visible otherwise this algo won't work on it. I have added 10 images in the database which will help you in understanding the main algorithm of this project. So, let's get started with Eye Ball Detection in MATLAB:

Eye Ball Detection in MATLAB

  • So, first of all, click the below button in order to buy this Eye Ball Detection Project in MATLAB.

Buy This Simulation

  • Once you download the files, then open the files named as MainGUI.m.
  • Note, you must have MATLAB 2015 or higher in order to run this program correctly.
  • It will open up a window which will look something as shown in below figure:
  • One thing you should remember that MATLAB is not much good with graphics so you may have to change your axes' sizes.
  • Anyways now click the button which says Browse and open any of the images present in the folder and then click Load Image button.
  • I have opened the below image:
  • If everything goes fine then you will get results something as shown in below figure:
  • So, you can see in the above figure that I have labelled all the images of Eye Ball Detection in MATLAB.
  • These labels are actually the steps in which we are doing our Eye Ball Detection.
  • So, first of all I cropped the Pair of eyes and shown it in the Figure 2.
  • After that I gray scaled the image and it is shown in Figure3.
  • Next thing we need to do is to crop single eye from the pair of eyes which is done in Figure 4.
  • In Figure 5, I have simply converted my gray scale image into binary image.
  • In Figure 6, I have applied some filters to make it more smooth and to ignore noises.
  • In Figure 7, I have taken the inverse of image in Figure 6. That's why now Eye Ball is showing in white color and rest of the background is in black.
  • In Figure 8 and 9, I have applied filters, filters are always used to remove noise and to make figure more visible.
  • In figure 10, I have taken the edges of the previous image.
  • Finally in Figure 11, I have detected the circular region and then plotted a circle around it and I have done the same thing in Figure 12.
  • Here's the results of another image for Eye Ball Detection in MATLAB:
  • As, I have told earlier that our team has done a lot of effort in designing this project that's why we haven't shared its code but you can buy it quite easily from our shop by clicking the above button.
  • Moreover, I have designed this video which will help you better in understanding this project.
  • So, please must watch this video before buying this simulation so that you are sure what you are buying. you can also contact us if you are having any problems in buying it.
  • Here's the video for EyeBall Detection in Matlab:
So, that's all about Eye Ball Detection in MATLAB. I hope you guys have enjoyed today's post. Will meet you guys in the next tutorial. Till then take care and have fun !!! :)

Interfacing of Keypad with PIC Microcontroller

Hello everyone, I hope you all are doing great. Today, I am going to share a very basic tutorial on PIC Microcontroller, which is Interfacing of Keypad with PIC Microcontroller. I have designed this simulation of Keypad with PIC Microcontroller in Proteus ISIS and the simulation along with code is given below for download. But I would suggest you to read it first and then design it on your own so that you learn most out of it. In today's tutorial, I am not gonna discuss the details of How keypad works because I have discussed it in detail in my old tutorial Interfacing of Keypad with Arduino so if you don't have much idea about working of keypad then I would recommend you to read that tutorial first, before proceeding with today's tutorial. I have also interface this Keypad with 8051 Microcontroller, so today we are gonna interface this keypad with PIC Microcontroller. I have written programming code for this project in MikroC Pro For PIC. So, let's get started with Interfacing of Keypad with PIC Microcontroller:

Interfacing of Keypad with PIC Microcontroller

  • First of all, you can download the Simulation for this project along with programming code by clicking the below button:

Download Code & Simulation

  • Now, let's design it step by step.
  • I have used LCD Library for Proteus so download it first and then run this simulation.
  • First of all, design a simple simulation in Proteus software as shown in below figure:
  • Now paste the below programming code in MikroC Pro For PIC.
  • In this Programming code, the key pressed on keypad will be displayed on the LCD.
  • So, when you press any button on the keypad, it will appear on the LCD.
  • Here's the code which you need to use in MikroC Pro For PIC:
unsigned short kp, cnt, oldstate = 0;
char txt[6];

char  keypadPort at PORTD;

sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB2_bit;
sbit LCD_D5 at RB3_bit;
sbit LCD_D6 at RB4_bit;
sbit LCD_D7 at RB5_bit;

sbit LCD_RS_Direction at TRISB0_bit;
sbit LCD_EN_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB4_bit;
sbit LCD_D7_Direction at TRISB5_bit;


void main() {
  cnt = 0;
  Keypad_Init();
  Lcd_Init();
  Lcd_Cmd(_LCD_CLEAR);
  Lcd_Cmd(_LCD_CURSOR_OFF);
  Lcd_Out(3, 2, "The Engineering");
  Lcd_Out(4, 5, "Projects");
   Lcd_Out(1, 1, "Key Pressed:");

  do {
    kp = 0;
    do
      kp = Keypad_Key_Click();
    while (!kp);
    
    switch (kp) {
      case 10: kp = 42; break;  // '*'
      case 11: kp = 48; break;  // '0'
      case 12: kp = 35; break;  // '#'
      case  1: kp = 49; break; // 1
      case  2: kp = 50; break; // 2
      case  3: kp = 51; break; // 3
      case  4: kp = 65; break; // A
      case  5: kp = 52; break; // 4
      case  6: kp = 53; break; // 5
      case  7: kp = 54; break; // 6
      case  8: kp = 66; break; // B
      case  9: kp = 55; break; // 7
      case 10: kp = 56; break; // 8
      case 11: kp = 57; break; // 9
      case 12: kp = 67; break; // C
      case 13: kp = 42; break; // *
      case 14: kp = 48; break; // 0
      case 15: kp = 35; break; // #
      case 16: kp = 68; break; // D

    }

    Lcd_Chr(1, 14, kp);
  } while (1);
}
  • Now get your hex file and upload it in your Proteus Simulation.
  • Run your simulation and if everything goes fine then you will get results as shown in below figure:
  • So, in the above figure, I have pressed button 5 on the keypad and it is shown on the LCD.
  • Here's the video demonstration which will help you better in understanding this project:
So, that's how we can interface our Keypad with PIC Microcontroller. If you got into any trouble following this tutorial then ask your problems in the comments and I will help you out. That's all for today, I hope you guys can now interface keypad with PIC Microcontroller easily. :)

Interfacing of Arduino with GLCD

Hello friends, I hope you all are doing great and having fun with your lives. In today's tutorial, I am going to share How to interface Arduino with GLCD. I am gonna design a Proteus Simulation in which I will interface Arduino GLCD together. GLCD is also called Graphical LCD so today we are gonna do some designing on the LCD. The GLCD I am going to use is ks0108 and its model in Proteus is LGM12641BS1R and I have shared the complete Simulation along with Arduino Code below for download. But I would suggest you to design it on your own so that you could get the most out of it. If you haven't worked on the LCD before then I would suggest you to read How to Interface Simple LCD with Arduino. Moreover, I am quite happy to announce that we have started TEP Forum so if you guys have any questions related to your engineering projects then ask in our forum and we will try our best to resolve your issues. Anyways, let's get back to our today's tutorial and interface Arduino GLCD in Proteus ISIS.

Interfacing of Arduino with GLCD

  • First of all, you can download the Proteus Simulation and Arduino Code for Interfacing of Arduino with GLCD, by clicking the below button:

Download Code & Simulation

  • Now let's design it so that you can understand how this is working.
  • So, first of all design a Proteus Simulation for Interfacing of Arduino with GLCD, as shown in below figure:
Note: Proteus doesn't have Arduino in its database so you need to install this Arduino Library for Proteus if you wanna use Arduino in Proteus.
  • Now upload the below Arduino code in your Arduino Software and Get your Arduino Hex File, which we are gonna upload in our Proteus Arduino.
  • Here's the Arduino Code for Interfacing of Arduino with GLCD:
Note:
  • You also have to install the GLCD Library for Arduino, I have added this library in the above package so when you download it first of all install this library in Arduino Software.
#include <glcd.h>
#include "fonts/allFonts.h"        
#include "bitmaps/allBitmaps.h"    

Image_t icon;

gText textArea;              
gText textAreaArray[3];     
gText countdownArea =  gText(GLCD.CenterX, GLCD.CenterY, 1, 1, Arial_14); 

unsigned long startMillis;
unsigned int  loops = 0;
unsigned int  iter = 0;
         int  theDelay = 20; 

void setup()
{
  GLCD.Init();
  if(GLCD.Height >= 64)   
    icon = ArduinoIcon64x64;  
  else
    icon = ArduinoIcon64x32;  

  GLCD.ClearScreen(); 

  GLCD.SelectFont(System5x7, BLACK); 
  GLCD.CursorTo(2, 2);
  GLCD.print("The Engineering");
  GLCD.CursorTo(5, 3);
  GLCD.print("Projects");
}


void  loop()
{  
  
}
  • So, now if everything goes fine then when you run your Proteus Simulation of Arduino with GLCD, you will get results as shown in below figure:
  • So, what we have done is we just printed our blog name on the GLCD using Arduino.
  • Now, in the package you download I have also added another example which when you upload will give you a demo of GLCD.
  • Here's the results of the second example, I have added some screenshots:
  • So, that's how you can interface Arduino with GLCD and can design anything you want.
  • It's really very easy but quite lengthy, I must tell.
  • I have designed this video which will help you in better understanding:
So, that's all about Interfacing of Arduino with GLCD and I hope I have helped you guys in some ways. So, will meet you guys in the next tutorial. Till then take care and have fun !!! :)

How to use Arduino PWM Pins

Hello friends, I hope you all are doing great. In today's tutorial, I am going to show you How to use Arduino PWM Pins. It's the next tutorial in our new Arduino Tutorial for Beginners series. We will design a small code in which we will be controlling a dc motor's speed using the Arduino PWM Pins but before going into the details, let me first give you an introduction to Arduino PWM Pins because without understanding the PWM, which is the abbreviation of Pulse Width Modulation, you won't be able to understand How to use Arduino PWM Pins. In our previous tutorial, we have seen How to use analogWrite in Arduino and I have told you in that tutorial that we use this command for PWM as well. So, today we will have a look at How to do that. PWM is an abbreviation of Pulse Width Modulation, its a simple technique in which we just modulate the width of a pulse to get our required results. Suppose, we have a 12V DC signal but my requirement is to get the 6V instetad of 12V so here what I need is PWM. I will use PWM on 12V signal and then reduce it to 6V. Another important thing related to PWM is duty cycle. Duty Cycle is the percentage for which the pulse remains HIGH. For example, if the pulse is of 12V and you turn it into 6V using PWM then the duty cycle of PWM is 50%. I have posted many tutorials on PWM for example you should have a look at How to Generate PWM in 8051 Microcontroller. In this tutorial, I have explained in detail about PWM signal. Moreover, you can also have a look at DC Motor Speed Control using Arduino in which I have controlled the speed of DC Motor with LDR Sensor. Anyways, let's get back to How to use Arduino PWM Pins:

How to use Arduino PWM Pins ???

  • You can download the complete simulation along with its Arduino code for Arduino PWM by clicking the below button:

Download Simulation & Cod

  • First of alll, we should know which pins of Arduino can be used for PWM purposes.
  • So, if you have a look at the below figure, its an Arduino UNO and all the pins of Arduino UNO which has this sign "~" in front of them are PWM pins.
  • If you have a look at the above Arduino UNO image then you can see that "~" this sign is placed in front of six pins.
  • So, Arduino UNO PWM Pins are:
  • Pin # 3
  • Pin # 5
  • Pin # 6
  • Pin # 9
  • Pin # 10
  • Pin # 11
  • Using these PWM Pins, you can create the PWM pulse which we are gonna do rite now. :)
  • So, design a simulation in Proteus as shown in the below figure:
  • As you can see in the above figure that I have used LDR Sensor with Arduino UNO and I have plotted the PWM output coming from Arduino UNO on the oscilloscope.
  • For PWM output the command used in Arduino is:

analogWrite(PWM_Pin, PWM_Value);

  • As, you can see its just an analog Write command and using it you can write any value to the PWM Pin ranging from 0 to 255.
  • At 0 the duty cycle of PWM will be 0% and at 255 it will be 100%.
  • So, what I did in the above example is I just take the analog value coming from LDR and then transferred it to PWM Pin of Arduino UNO.
  • So, now upload the below code in your Arduino board:
int PWMControl= 6;
int PWM_Input = A0;

int PWM_Value = 0;

void setup() {
    pinMode(PWMControl, OUTPUT);
    pinMode(PWM_Input, INPUT);
    Serial.begin(9600);
}

void loop() 
{
    PWM_Value = analogRead(PWM_Input);
    PWM_Value = map(PWM_Value, 0, 1023, 0, 255);
    analogWrite(PWMControl, PWM_Value);
}
  • So, now Get your Arduino Hex File and upload it in your Proteus software.
  • You will also need to download Arduino Library for Proteus, if you wanna use this Arduino UNO in Proteus.
  • Now, if everything goes fine then you will get results as shown in below figure:
  • Now you can see in the above figure that I have shown the PWM pulse in the oscilloscope and now when you change the LDR value then this pulse's PWM will also change.
  • You can download the complete simulation with Arduino code by clicking the button above.
  • If you have any problems or issues in this Arduino PWM tutorial then let me know in comments.
I hope you have enjoyed today's post on Arduino PWM Pins and I would suggest you to have a look at DC Motor Speed Control using Arduino, it will help you a lot in understanding the basic concept of Arduino PWM. So, that's all about Arduino PWM, will see you guys in the next tutorial. Till then take care and have fun !!! :)

Arduino Tutorial for Beginners

Hello friends, I hope you all are fine and having fun with your lives. Today, I am going to share a complete Arduino Tutorial for Beginners because I was having a lot of requests about it. Reader were asking the same question that they are new to Arduino and how should they start so if you are beginner to Arduino and you don't have any idea How to learn it then you should read the below tutorials. I have posted all the basic Arduino Tutorial for Beginners already so in today's tutorial I am just gonna arrange them and must ask you to read them one by one from top to bottom and at then end you will really be able to design any kind of project on Arduino. So, let's get started with Arduino Tutorial for Beginners:

Arduino Tutorial for Beginners

Before going into the practical Arduino Programming, you must first read some theoretical knowledge about Arduino which will really help you out in your Arduino Projects. So these are the basic Arduino tutorial which I will post here step by step: What is Arduino ? First of all, you should read this tutorial in which I have given the basic introduction of Arduino. This tutorial is essential one, if you are new to Arduino. Arduino Vs Raspberry Pi Next thing you should read is Arduino Vs Raspberry Pi,  its not that important but its always good to have a look at alternatives. Installation of Arduino Driver in Windows Now, I suppose that you know the basics of Arduino and have got your Arduino UNO in your hand and are ready to install Arduino Drivers in your Windows. Arduino Library for Proteus Next thing you need to read is How to use Arduino Library for Proteus. Using this library you can easily simulate your Arduino boards in Proteus software. Getting Started with Arduino Software Now you have the basic idea of Arduino board and you know How to use it in Proteus, the next thing you need to do is to have some understanding about Arduino software.

Basic Arduino Commands

Now, that you have understood the basics of Arduino and its programming so now let's have a look at some Basic Arduino Commands and I would suggest you to test these commands in Proteus on your own so that you do mistakes and get some knowledge from them. Anyways, let's continue with these Basic Arduino Commands: Getting Started with Arduino Programming After having a look at the Arduino software, next thing you need to do is to read about Getting Started with Arduino Programming. Arduino Data Types Then we have a tutorial at Arduino Data Types in which we have explained in detail all the Data Types of Arduino. How to use pinMode in Arduino How to use pinMode in Arduino is the next tutorial which you must read so that you have an idea about how to make pins input or output. How to use DigitalRead in Arduino How to use DigitalRead in Arduino is the next tutorial which you must read so that you have an idea about how to use the digital Pins of Arduino. How to use DigitalWrite in Arduino How to use DigitalWrite in Arduino is the next tutorial which you must read so that you have an idea about how to use the digital Pins of Arduino. How to use AnalogRead in Arduino How to use AnalogRead in Arduino is the next tutorial and I have explained here how to read the status of analog Pins. How to use AnalogWrite in Arduino Analog Write is used to update the status of analog Pins as well as PWM Pins. Here we will discuss this command and in next tutorial we will have a look at PWM Pins. How to use Arduino PWM Pins How to use DigitalRead in Arduino is the next tutorial which you must read so that you have an idea about how to use the digital Pins of Arduino. A Simple Arduino LED Example First of all, you should have a look at A Simple Arduino LED Example in which I have designed a simple example in Proteus and blinked the LED at Pin # 13 of Arduino. How to write Arduino code Next article you should have a look at is How to write Arduino code, in this tutorial I have explained how to write arduino code efficiently. At the end, I would suggest you to have a look at this list of Arduino Projects in which I have given all the Arduino Projects which are posted on our blog, so once you get trained in Arduino then you can try those projects and can get pro in Arduino.  

The Practical Guide for Tech Entrepreneurs

Even the best tech entrepreneurs have made mistakes while working their way to the top. Many of the past and present entrepreneurs have difficulty making their businesses succeed. It is a rough world for beginners. It is hard to succeed when a person does not know how to grow their business and make a financial gain. The Practical Guide for Entrepreneurs has been written to assist other entrepreneurs. It teaches the steps of what to do and what not to do as a beginner. The guide answers a lot of questions that tech startup has. They are informative and knowledgeable in the steps to take to make a business excel. The valuable information can impact their tech business and help it financially grow into something bigger. The entrepreneur guide has important information that should be followed and examples of decisions to stay away from.

Start at The Beginning

A tech entrepreneur should start with getting your office or space ready to conduct business. Get the area ready and supplies set up for a tech business. It is very important to always find ways to lessen your business cost. From office supplies to technology, find discount deals from different shops that offer promo codes such as Currys and Sprint. Also, find team members who want to work with you. If you need other items such as the internet, then this would be the time to purchase them. It is important to be prepared and educated on what to expect next. The guide explains these and many other pieces of information about how to begin as a tech entrepreneur.

Capital Gain and Finances

The Practical Guide for Tech Entrepreneurs discusses how to get financial assistance and capital gain. Financial stability is important to understand for a tech startup. A business that has money to create more business, is a surviving company. There are businesses that had begun as tech entrepreneurs. These companies have risen above and created a huge name for themselves.

Knowledge of Surroundings

A tech entrepreneur needs to know the surroundings. Being able to recognize bad deals is important. It is a good idea to say no to a bad investment or proposition. If you feel that your surroundings are not improving, then it is time to get out. If at some point, you need to get out from under the company, then it is best to take the time to do some research. Find out who would be the best buyer and ensure that the team is taken care of. The guide explains how to make a decision that works well for everyone involved.

Lead by Example

A tech entrepreneur can review the companies that have succeeded and grown their companies and brands. These companies are great resources. The entrepreneurs can learn and study the way these companies had conducted business and overcome the challenges to excel in the industry. A tech entrepreneur will benefit from the guide because of the valuable and educational information. There are many wonderful tips and suggestions to help people in the tech world to succeed. It also teaches the mistakes to avoid and ways to improve from those bad choices.

Arduino Data Types

Hello everyone, I hope you all are fine and having fun with your lives. In today's post, I am going to share all about Arduino Data Types. Arduino Data Types play an important role in Arduino Programming and I have discussed them a little in my tutorial on How to do Arduino Programming. But today, we are gonna discuss it in more detail. I hope you guys are gonna enjoy from them and are gonna get benefit using them. Before going any further I think you must have a llok at Arduino Basic Tutorials in which I have explained everything in a very easy way. Anyways, Till now I hopeo that you have the basic know how of Arduino Programming and you ahave also worked on Arduino LED Example. So, let's get started with Arduino Data Types:

What are Data Types ??

  • If you recall your basic mathematics in which we have learned about sets like Whole Numbers, Natural Number, Prime Numbers etc.
  • So, in simple words, Data Types are such sets, but Data Types are different on the nature of element storing in them.
  • Data type is like a place, so when we initialize our variale then we tell our compiler that our newly introduced integer is of which type.
  • Is it an integer or it has decimal as well in it or its some character like A, B, C etc.
  • So, we have to tell our compiler the nature of our variable and that's where Data Types are required.
  • So, that's a little Introduction of Data Types, now let's have a look at Arduino Data Types:

Arduino Data Types

  • Arduino Data Types are almost similar to C++ Data Types because it roughly follows the same syntax.
  • So, now I am gonna discuss the most commonly used Arduino Data Types one by one:
Int - Arduino Data Types
  • Int is short form for Integer.
  • This Arduino Data Types can store a data of 16 Bit.
  • Int data ranges from -32,768 to 32767.
  • In Arduino Programmer, Int variable in initialized in several ways, which are:

int Value = 0;

int Value;

int Value1, Value2, Value3;

Char - Arduino Data Types
  • char is short for character.
  • This Arduino Data Type has a memory of 8 Bit or 1 byte.
  • Char Data Type saves charracters like A, B, C etc.
  • If you are initializing a single character then it will be in single quotes like 'A'.
  • But if you are dealing with character Array then it must be enclosed in doule brackets like this "ABCD".
  • When we save any character then in actual the ascii code of that character is being saved.
  • For example if you save a character '1', then its not integer 1 it is a character '1' and its ascii value is 49.
  • So, in that variable the value saved is 49.
  • All the Serial Communication is done using this char Data Type.
  • You should read How to do Arduino Serial Communication in which I have used this char variable.
Boolean - Arduino Data Types
  • Boolean data type is also used quite a lot in Arduino Programming.
  • Boolean is also of 8 Bit just like char and it can be either True or False, that's why we call it Boolean.
  • So, we can initialize a Boolean variable as:

boolean a;

Float - Arduino Data Types
  • Float is another very important Arduino Data type.
  • The unique thing of Float Data Type is that we can store decimal numbers in it.
  • For example I want to save 2.51 then I have to use Float because this value can't be save in Int or Char.
The above mentioned Arduino Data Types are the most commonly used data types and I hope you got their details in today's tutorial. In the below figure, I have mentioned all details about Arduino Data Types: So, that's all about Arduino Data Types. In the coming tutorial I will share more about Arduino. So, take care and have fun !!! :)

How to write Arduino code ?

Hello everyone, I hope you all are fine and having fun. In today's tutorial, I am going to show you How to write Arduino code. In the previous tutorial, we have seen the Simple Arduino LED Example so if you haven't read that tutorial then I must suggest you to read it first because I am gonna use the same simulation with some advancements in it. Moreover, you should also have a look at How to do Arduino Serial Communication because we are also gonna use Serial Port in today's tutorial and one more tutorial which you must read is How to use digitalRead in Arduino because we are dealing with digital pins here. So, I hope that you have read those tutorial and are ready to learn How to write Arduino code. So, let's have a look at How to write Arduino Code:

How to write Arduino code ?

  • In the previous tutorial named as Arduino LED Example, we have designed a simulation in which I have made some changes and added few buttons in it.
  • This new modified simulation is shown in below figure:
  • You can see in the above figure that I have connected LEDs with all the digital Pins and Logic State with all the analog pins and a Virtual Terminal is connected with Pin # 0 and 1 of Arduino.
  • You can download the complete simulation with Proteus code for this tutorial How to write Arduino Code by clicking the below button:

Download Simulation & Code

Note:
  • We can also use Analog Pins as digital and that's what we are gonna do in today's tutorial.
  • So, that's why I have placed digital logic state which is actually acting as a button here.
  • Moreover, if you haven't worked with Virtual Terminal then you should read How to use virtual Terminal in Proteus.
  • If you have a look at the previous code then you must have remembered that it was quite lengthy and I have mentioned that we will make it efficient in the next tutorial.
  • So, now let's make a small code in which we will blink these LEDs one by one.
  • But before going any further, you must first read Getting Started with Arduino Programming so that you also know the basics of Arduino Programming structure.
  • So, now I am going to make a small function which I will call in the Main loop function every time I need to blink the LED.
  • So, that lengthy code is now gonna compress to small code and is given below:
// ===== It's the First Version ========

int Led1 = 13;
int Led2 = 12;
int Led3 = 11;
int Led4 = 10;
int Led5 =  9;
int Led6 =  8;
int Led7 =  7;
int Led8 =  6;
int Led9 =  5;
int Leda =  4;
int Ledb =  3;
int Ledc =  2;

int Led = 0;

void setup() 
{
    pinMode(Led1, OUTPUT);
    pinMode(Led2, OUTPUT);
    pinMode(Led3, OUTPUT);
    pinMode(Led4, OUTPUT);
    pinMode(Led5, OUTPUT);
    pinMode(Led6, OUTPUT);
    pinMode(Led7, OUTPUT);
    pinMode(Led8, OUTPUT);
    pinMode(Led9, OUTPUT);
    pinMode(Leda, OUTPUT);
    pinMode(Ledb, OUTPUT);
    pinMode(Ledc, OUTPUT);
}

void loop() 
{
    LedBlinkFunction(1);   
    delay(1000);
    LedBlinkFunction(2);   
    delay(1000);
    LedBlinkFunction(3);   
    delay(1000);
    LedBlinkFunction(4);   
    delay(1000);
    LedBlinkFunction(5);   
    delay(1000);
    LedBlinkFunction(6);   
    delay(1000);
    LedBlinkFunction(7);   
    delay(1000);
    LedBlinkFunction(8);   
    delay(1000);
    LedBlinkFunction(9);   
    delay(1000);
    LedBlinkFunction(10);   
    delay(1000);
    LedBlinkFunction(11);   
    delay(1000);
    LedBlinkFunction(12);   
    delay(1000);
    LedsOFF();
    delay(1000);
}

void LedBlinkFunction(int LedNo)
{
    if(LedNo == 1){Led = Led1;}
    if(LedNo == 2){Led = Led2;}
    if(LedNo == 3){Led = Led3;}
    if(LedNo == 4){Led = Led4;}
    if(LedNo == 5){Led = Led5;}
    if(LedNo == 6){Led = Led6;}
    if(LedNo == 7){Led = Led7;}
    if(LedNo == 8){Led = Led8;}
    if(LedNo == 9){Led = Led9;}
    if(LedNo ==10){Led = Leda;}
    if(LedNo ==11){Led = Ledb;}
    if(LedNo ==12){Led = Ledc;}
   
    digitalWrite(Led, HIGH);
}

void LedsOFF()
{
    digitalWrite(Led1,  LOW);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc,  LOW);   
}
  • You can see the above code is totally different from the one we have used in Arduino LED Example.
  • In the above code I have created two functions named as LedBlinkFunction(int LedNo) and LedsOFF().
  • So, that way, I have made the code short as well as efficient.
  • So, now add this code in your Arduino sofware and Get your Arduino Hex File.
  • Upload this hex file in Proteus and if everything goes fine then you will get results as shown in below figure:
  • The abovecode is quite small as compared to the previous one but let's make it more short and efficient.
  • Now, I am gonna use the For Loop which I haven't used before and that way I don't need to call that function every time instead I will just call it in For Loop so let's have a look at the below code:
// ===== It's the Second Version ===========

int Led1 = 13;
int Led2 = 12;
int Led3 = 11;
int Led4 = 10;
int Led5 =  9;
int Led6 =  8;
int Led7 =  7;
int Led8 =  6;
int Led9 =  5;
int Leda =  4;
int Ledb =  3;
int Ledc =  2;

int Led = 0;

void setup() 
{
    pinMode(Led1, OUTPUT);
    pinMode(Led2, OUTPUT);
    pinMode(Led3, OUTPUT);
    pinMode(Led4, OUTPUT);
    pinMode(Led5, OUTPUT);
    pinMode(Led6, OUTPUT);
    pinMode(Led7, OUTPUT);
    pinMode(Led8, OUTPUT);
    pinMode(Led9, OUTPUT);
    pinMode(Leda, OUTPUT);
    pinMode(Ledb, OUTPUT);
    pinMode(Ledc, OUTPUT);
}

void loop() 
{
    for(int x = 1; x < 13; x++)
    {
        LedBlinkFunction(x);   
        delay(1000);
    }
    
    LedsOFF();
    delay(1000);
}

void LedBlinkFunction(int LedNo)
{
    if(LedNo == 1){Led = Led1;}
    if(LedNo == 2){Led = Led2;}
    if(LedNo == 3){Led = Led3;}
    if(LedNo == 4){Led = Led4;}
    if(LedNo == 5){Led = Led5;}
    if(LedNo == 6){Led = Led6;}
    if(LedNo == 7){Led = Led7;}
    if(LedNo == 8){Led = Led8;}
    if(LedNo == 9){Led = Led9;}
    if(LedNo ==10){Led = Leda;}
    if(LedNo ==11){Led = Ledb;}
    if(LedNo ==12){Led = Ledc;}
   
    digitalWrite(Led, HIGH);
}

void LedsOFF()
{
    for(int x = 2; x < 13; x++)
    {
        digitalWrite(x, LOW);
    }  
}
  • Now, you can see in the above code that I have used the For Loop in Main Loop function as well as in LedsOFF() Function.
  • And you can see the code has become quite small and more understanding.
  • The result of this code is exactly the same as the First Code.
  • Now let's have a look at those switches, I will design another code in which I will add different LEDs routines on each button press.
  • Like if you press the first button then it will start from top and if you press the second button then it will start from bottom and similar functions on other buttons.
  • So, here's the code which you need to add in your Arduino:
int Led1 = 13;
int Led2 = 12;
int Led3 = 11;
int Led4 = 10;
int Led5 =  9;
int Led6 =  8;
int Led7 =  7;
int Led8 =  6;
int Led9 =  5;
int Leda =  4;
int Ledb =  3;
int Ledc =  2;

int Led = 0;

int Button1 = A0;
int Button2 = A1;
int Button3 = A2;
int Button4 = A3;
int Button5 = A4;
int Button6 = A5;

void setup() 
{
    Serial.begin(9600);
    pinMode(Led1, OUTPUT);
    pinMode(Led2, OUTPUT);
    pinMode(Led3, OUTPUT);
    pinMode(Led4, OUTPUT);
    pinMode(Led5, OUTPUT);
    pinMode(Led6, OUTPUT);
    pinMode(Led7, OUTPUT);
    pinMode(Led8, OUTPUT);
    pinMode(Led9, OUTPUT);
    pinMode(Leda, OUTPUT);
    pinMode(Ledb, OUTPUT);
    pinMode(Ledc, OUTPUT);

    pinMode(Button1, INPUT_PULLUP);
    pinMode(Button2, INPUT_PULLUP);
    pinMode(Button3, INPUT_PULLUP);
    pinMode(Button4, INPUT_PULLUP);
    pinMode(Button5, INPUT_PULLUP);
    pinMode(Button6, INPUT_PULLUP);
}

void loop() 
{
    if(digitalRead(Button1) == HIGH)
    {
        for(int x = 1; x < 13; x++)
        {
            LedBlinkFunction(x);   
            delay(1000);
        }
        
        LedsOFF();
        delay(1000);
    }

    if(digitalRead(Button2) == HIGH)
    {
        for(int x = 13; x > 0; x--)
        {
            LedBlinkFunction(x);   
            delay(1000);
        }
        
        LedsOFF();
        delay(1000);
    }

    if(digitalRead(Button3) == HIGH)
    {
        LedsON();
        delay(1000);
        LedsOFF();
        delay(1000);
    }

    if(digitalRead(Button4) == HIGH)
    {
        Serial.print("www.TheEngineeringProjects.com");
        while(digitalRead(Button4) == HIGH);
    }

    if(digitalRead(Button5) == HIGH)
    {
        if(Serial.available())
        {
            char data = Serial.read();
            data = data - 49;
            digitalWrite(data, HIGH);
        }
    }

    if(digitalRead(Button5) == HIGH)
    {
        
    }
}

void LedBlinkFunction(int LedNo)
{
    if(LedNo == 1){Led = Led1;}
    if(LedNo == 2){Led = Led2;}
    if(LedNo == 3){Led = Led3;}
    if(LedNo == 4){Led = Led4;}
    if(LedNo == 5){Led = Led5;}
    if(LedNo == 6){Led = Led6;}
    if(LedNo == 7){Led = Led7;}
    if(LedNo == 8){Led = Led8;}
    if(LedNo == 9){Led = Led9;}
    if(LedNo ==10){Led = Leda;}
    if(LedNo ==11){Led = Ledb;}
    if(LedNo ==12){Led = Ledc;}
   
    digitalWrite(Led, HIGH);
}

void LedsOFF()
{
    for(int x = 2; x < 14; x++)
    {
        digitalWrite(x, LOW);
    }  
}

void LedsON()
{
    for(int x = 2; x < 14; x++)
    {
        digitalWrite(x, HIGH);
    }  
}
  • Now when you upload the code, you will get the similar results but now you must press the buttons and you will see different functionalities of LEDs.
  • The results are given in the below video:
I hope you have enjoyed How to write Arduino code and are gonna get help from it. That's all about How to write Arduino code. So, will meet you guys in the next tutorial. Take care and have fun !!! :)

A Simple Arduino LED Example in Proteus

Hello friends, I hope all are fine and having fun with your projects. We have covered enough Arduino commands in this Arduino Tutorial for Beginners series and now we are ready to create a simple project by interfacing an LED (Light Emitting Diode). Today, I am going to share a very Simple Arduino LED Example in Proteus ISIS. First I will blink single LED using Arduino UNO and then I will blink multiple LEDs in Proteus. When you start working on Arduino then Arduino LED example is the first example which you must try because its the easiest one. Moreover, we all know that we have a small LED connected to pin # 13 on each Arduino so you can also check your Arduino as well that whether its working or not. So, let's get started with Simple Arduino LED Example in Proteus ISIS:

A Simple Arduino LED Example in Proteus

  • You can download, all the simulation files and codes for Arduino LED examples used in this tutorial, by clicking the below button:

Download Simulation Files

  • First of all, design a simple circuit of Arduino LED in Proteus ISIS as shown in below figure:
  • Now as you can see in the above figure that I have used an LED on Pin # 13 of Arduino UNO.
  • So, now upload the below sketch in your Arduino, its the Blink Example from Arduino, which works perfect for this Arduino LED Example:
void setup() {
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}
  • The above code is quite simple and you can see first we have used the pinMode Arduino Command to make the LED pin Output.
  • After that, we have used Arduino digitalWrite Command to blink the LED.
  • Now get the hex file from Arduino software and add it in your Proteus Arduino board.
  • Once the hex file is uploaded in the Arduino then run your Arduino LED Proteus Simulation and if everything goes fine then your LED will start blinking as shown in below figure:
  • Now you can see in the above figure that our LED at Pin # 13 started blinking.
  • If you read the above code of Arduino LED exmaple then its quite simple, first of all I just make the Pin # 13 output and then I have made it HIGH and LOW with a delay of 1000 msec.
  • You might wanna read How to use digitalRead in Arduino that will give you a better idea of How to deal with any digital pin.
  • So, now let's add more LEDs on other digital Pins of Arduino.
  • So, design a simulation as shown in the below figure:
int Led1 = 13;
int Led2 = 12;
int Led3 = 11;
int Led4 = 10;
int Led5 =  9;
int Led6 =  8;
int Led7 =  7;
int Led8 =  6;
int Led9 =  5;
int Leda =  4;
int Ledb =  3;
int Ledc =  2;

void setup() 
{
    pinMode(Led1, OUTPUT);
    pinMode(Led2, OUTPUT);
    pinMode(Led3, OUTPUT);
    pinMode(Led4, OUTPUT);
    pinMode(Led5, OUTPUT);
    pinMode(Led6, OUTPUT);
    pinMode(Led7, OUTPUT);
    pinMode(Led8, OUTPUT);
    pinMode(Led9, OUTPUT);
    pinMode(Leda, OUTPUT);
    pinMode(Ledb, OUTPUT);
    pinMode(Ledc, OUTPUT);
}

void loop() 
{
    digitalWrite(Led1, HIGH);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc,  LOW);    
    delay(1000);

    digitalWrite(Led1,  LOW);
    digitalWrite(Led2, HIGH);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc,  LOW); 
    delay(1000);

    digitalWrite(Led1,  LOW);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3, HIGH);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc,  LOW); 
    delay(1000);

    digitalWrite(Led1,  LOW);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4, HIGH);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc,  LOW); 
    delay(1000);

    digitalWrite(Led1,  LOW);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5, HIGH);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc,  LOW); 
    delay(1000);

    digitalWrite(Led1,  LOW);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6, HIGH);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc,  LOW); 
    delay(1000);

    digitalWrite(Led1,  LOW);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7, HIGH);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc,  LOW); 
    delay(1000);

    digitalWrite(Led1,  LOW);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8, HIGH);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc,  LOW); 
    delay(1000);

    digitalWrite(Led1,  LOW);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9, HIGH);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc,  LOW); 
    delay(1000);

    digitalWrite(Led1,  LOW);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda, HIGH);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc,  LOW); 
    delay(1000);

    digitalWrite(Led1,  LOW);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb, HIGH);
    digitalWrite(Ledc,  LOW); 
    delay(1000);

    digitalWrite(Led1,  LOW);
    digitalWrite(Led2,  LOW);
    digitalWrite(Led3,  LOW);
    digitalWrite(Led4,  LOW);
    digitalWrite(Led5,  LOW);
    digitalWrite(Led6,  LOW);
    digitalWrite(Led7,  LOW);
    digitalWrite(Led8,  LOW);
    digitalWrite(Led9,  LOW);
    digitalWrite(Leda,  LOW);
    digitalWrite(Ledb,  LOW);
    digitalWrite(Ledc, HIGH); 
    delay(1000);
}
  • Upload this hex file in your Proteus Arduino and then run your simulation.
  • If everything goes fine then you will get all your LEDs blinking.
  • I have shown a glimpse of its working in below figure:
  • So, download the files and run your simulation and test it out.
  • If you check the code then it seems quite lengthy but its very simple.
  • I am just keeping one LED on and others OFF.
  • Now, let me tell you one thing, this is not the best way of coding but for starters you should first try it out.
  • In the coming lecture, I will teach you How to write Arduino Code Efficiently like I don't wanna add 100 lines just for such small work.
So, that's all for today. I hope you have enjoyed today's Arduino LED Example and are gonna test it. So, see you in next tutorial. Take care !!! :)
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir