Anda di halaman 1dari 3

Internet of Things – Internship Program

Experiment list Day1

Programming with ‘C’

Lab - I

1. Write a program to print "National Institute of Electronics and Information


Technology" in the console.

2. Write a program to enter two numbers through keyboard and find their sum.

3. Two numbers are input through the keyboard into two locations C and D. Write a
program to interchange the contents of C and D.

4. Any integer is input through the keyboard. Write a program to find out whether it is
an odd number or even number.

5. Write a program to print the size of int,long int,double,char,float.

6. Temperature Conversions

a) Write a program to convert Fahrenheit temperature to their centigrade


equivalents.
b) C= (5/9) * (f -32) where c-centigrade & f-Fahrenheit

c) Modify the above program to compute the centigrade equivalent of


Fahrenheit temperatures of 0-300 in steps of 20 using while loop.

d) Write a program to convert Celsius to Fahrenheit.

e) Modify the temperature conversion program to convert and print the


temperature in reverse order from 300-0 in steps of 20.

7. A cashier has currency notes of denominations 10, 50 and 100. If the amount to be
withdrawn is input through the keyboard in tens, find the total number of currency
notes of each denomination the cashier will have to give to the withdrawer.

8. Write a program to determine whether the entered year is a leap year or not. (Hint:
Use the % (modulus) operator)

9. Write a recursive function to obtain the running sum of first n natural numbers.
Obtain the value of n from the user.

10. Write a program to find factorial using function

NIELIT, CALICUT
1
Internet of Things – Internship Program

Experiment list Day2


Arduino Programming

1. Write a program to Toggle LED connected to PORT 13 of Arduino with


500ms.
2. Write a program to Toggle LED connected to PORT 12 of Arduino with
250ms.
3. Write a program to Toggle LEDs at PORT12 and PORT13 with a rate of 1
sec alternatively.
4. Write a program to send the string “Internship @ NIELIT” on serial port
5. Turn on PORT13 LED on receiving data ‘T’ through Read the serial port
6. Turn on LEDs on receiving data as follows
a. RED LED on receiving ‘R’ through Read the serial port(PIN10)
b. GREEN LED on receiving ‘G’ through Read the serial port (PIN9)
c. BLUE LED on receiving ‘B’ through Read the serial port(PIN8)
7. Write a program to toggle the LED at Port 13 on receiving string “toggle”
if(Serial.available() > 0) {
color=Serial.readStringUntil('\r');//pass a value through
terminator until it complete.

if(color.equals("toggle"))
{
// perform action
}

8. Write a program to Toggle the LED on successive key press.


(Hint: For key use pull up mode)
9. Write a program to Toggle the LED on successive key press and send the
status through serial port.

NIELIT, CALICUT
2
Internet of Things – Internship Program

Experiment list Day3


Arduino Programming

1. Write a program to read the analog voltage from A2 (connected through


potentiometer)and view it on the serial terminal of Arduino IDE
2. Modify the above program and set an alarm (D12) when it reaches a
threshold.
3. Write a program to configure a RGB LEDs (D8, D9, D10) as battery level
indicator (Show the percentage as follows). Input read from A2 (POT)
a) 1)25% as Red
b) 2)50% as Blue
c) 3)75% -100% as Green
4. Modify the above program to turn on the Alarm (D12) blinking when it is
below 25% and turn off alarm at 30%. (Hysteresis)
5. Write a program to read the light intensity (use LDR connected to A0) and
observe the values on the serial window.
6. Modify the above a program to turn on an LED on D9 when the light
intensity is below a threshold value (Use LDR connected to A0).
7. Write a program turn on RGB LEDs (D8, D9, D10) with different
combinations of light intensity.
8. Program to read the ambient temperature scale it and show it in a serial
monitor.

NIELIT, CALICUT
3

Anda mungkin juga menyukai