Posts

Showing posts from December, 2019

Finding Smallest Number Among Three (Using C and function)

I got this problem while learning C in school and its worth learning. And you can use same method for C++ also. Write a program that takes three integers as input and prints the smallest and largest of these numbers. The main program must prompt for integers and read them. Write the functions largest() and smallest() that receive the entered numbers as their parameters. Correspondingly, the functions shall return values corresponding to their names. #include <stdio.h> int largest(int first, int second, int third); //making the function name and giving parameters int smallest(int first, int second, int third); int main() {     int a,b,c,largestNumber,smallestNumber;     printf("Enter the 1. number: ");     scanf("%d",& a);     printf("Enter the 2. number: ");     scanf("%d",& b);     printf("Enter the 3. number: ");     scanf("%d",& c);     largestNumber=largest(a,b,c); //storing the input

Use of LM35 with Arduino and LabVIEW

Image
LM35 + Arduino +LabVIEW I have the following link for the LM35 datasheet so you can check the pin assignment. Datasheet LM35 Connection from Arduino to LM35 1) LM35 Vout to Arduino Analog port (For example A0) (You need to change the wire to A0 in the following connection or you can change pin number in LabVIEW) 2) LM35 Gnd to Arduino Ground 3) LM35 Vcc to Arduino 5V Now connect the Arduino to PC and open LabVIEW. I have the LabVIEW code as follow: My room Temperature was around 23 °C but as you touch the LM35 the temperature will rise as you will see in WaveChart.  As I touched the LM35 the temperature rises.