Posts

How to interface LM35(Temperature Sensor) with Arduino

Image
       In this article, I am going to explain how to connect LM35 with Arduino. The LM35 series are precision integrated circuit temperature devices with an output voltage linearly proportional to the Centigrade temperature. It Operates from 4 V to 30 V and Calibrated Directly in Celsius (Centigrade). It Rated for Full −55°C to 150°C Range and low-Impedance Output, 0.1 Ω for 1-mA Load.          From Arduino ADC we read the analog value and then we will convert it to the °C. Arduino has 10bit ADC so we need to multiply the read value by 1024 and divide it by the voltage provided to LM35 to get the temperature in °C. void setup() { Serial.begin(9600); } void loop() { int analog = analogRead(A0); float MV = (analog/1024.0) * 5000; //5000 is the voltage provided float celsius = MV/10; Serial.print("In Degree Celsius= "); Serial.println(celsius); delay(1000); }           In above pr...

How to interface LED with Arduino

Image
            In this tutorial, I am going to tell you how to interface an LED with Arduino. I am using inbuilt LED of Arduino for this tutorial. Inbuilt LED is present at pin number 13. When the output signal is HIGH then LED turns on and when the output signal is LOW then the LED is off. In between on and off provided 1000ms delay to observe the output.             In void setup, the setup is provided that is pin 13 is made as an output pin and in void loop, the instructions are provided that executes continuously. In place of ledPin directly you can put pin number or LED_BUILTIN to connect the builtin LED. int ledPin = 13; void setup() { pinMode(ledPin,OUTPUT); } void loop() { digitalWrite(ledPin,HIGH); delay(1000); digitalWrite(ledPin,LOW); delay(1000); } Output When LED ON Output when LED OFF            Please feel f...

while statement in C programming

Image
        In the previous article, we have seen if, if....else Statement in C programming if you did not read the previous article you read it before proceeding further.        Loops are used to execute some block of statements repeatedly. It executes until termination condition gets executed. Types of loop statement are 1. if statement 2. while statement 3. do-while statement while statement            In while statement first the expression is tested. If true then program enters into the while loop and executes statements of while and after execution of all statements again condition is tested. If the condition is true then while loop again executed and it continues until the condition becomes false. If the condition becomes false the loop terminates and control comes out of while loop. The syntax for while statement: while(expression) { statement 1; statement 2; ...

if, if....else Statement in C programming

Image
        In the previous article we have seen How to Download and Install Code::Blocks and How To Create and Run Project In Code::Blocks if you did not read previous article you read it .                    The if, if....else and nested if ... else statements are used for decision purpose. In simple word you can say if this condition satisfies then execute this otherwise execute other. E.g If we entered one integer and we want to find it is even number or odd number. This decision can be made using if as well as if...else statement. if statement needs two condition as num%2==0 and num%2==1. If first condition is satisfies it returns num%2==0 statement otherwise it returns n%2==1 statement. In if .... else statement we need only one condition num%2==0. If even number is provided then it returns the first statement otherwise it returns the second statement. In the case of nested if ... else sta...

How To Create and Run Project In Code::Blocks

Image
        In the previous post, we have seen how to download and install Code::Blocks for C programming. If you did not read that article then read How to Download and Install Code::Blocks before proceeding further.        The code block is a popular application for C Programming. It is open source, cross platform, free C, C++ and Fortran IDE. Using Code::Blocks we can write C code, compile and run it. It popular application and free to use.         In this post, I am going to explain how to run and compile C program code in Code::Blocks. Lets us follow the procedure. The procedure is same for every project.          In the first step you have to double-click on the Code::Blocks icon which on the desktop. After that, you will see window like this and you have to click on Create New Project.           After sele...

How to Download and Install Code::Blocks

Image
Ocean of Programming         The code block is a popular application for C Programming. It is open source, cross-platform, free C, C++ and Fortran IDE. Using Code::Blocks we can write C code, compile and run it. It popular application and free to use. In this article, I am going to explain how to download and install it. Most people download and install the incorrect file and they face difficulties in compiling and running the C program. It is very simple to download install and configure the Code::Blocks. The current version of Code::Blocks is 16.01 which is released on Thursday, 28 January 2016 10:21which has many improvements, new plugins and features, more stable and major code completion enhancement. The Code::Blocks is available for Windows XP / Vista / 7 / 8.x / 10 Linux 32-bit Linux 64-bit Mac OS X          We need to download according to our operating system. I am downloading and installing Code::Blocks...

What is a Program?

Image
              Consider if you want to do some calculations then what we need? we need a calculator. Then what is calculator? The calculator is a simple program. That needs some language to create it. We can create a calculator in any language like C, Java, .net etc. We need only think which language is suitable for us and which type of interface is needed. If you want simple interface by showing options like addition, subtraction etc you can use C or C++ and if you want an interface like real calculator you can go through the Visual Basic, C# or .net which one is suitable for us.             Nowadays programming becomes very essential part. Think world without programming what will you see? You will see nothing. Without programming, you can not create anything new related to the computer. The program is a set or sequence of instructions which is written in a specific language.       ...