Professional Documents
Culture Documents
Iot - Practical File
Iot - Practical File
Expesimard I
//1. odtaut Rasphwvy Rand dey vouisus linus command,
incommard teuminal window
s, cd, touch, mv, Hm, nman, mkdir, mdir, tar, gzip, cat,
more, less, ps, Sudo, cOn, chown, charp ping et.
II2. BK
(b)Rad Rad(a) Birla
c).woxd acdditian
division#A3*5 subtractian
#A5-5 #A #An
stl&
fuquoy(st):
cha-def (5+5)/2muliplicaian -product
divison,
and
ncict tin/python
print#/usx/ namewit Run Institute
clict.kays()kys =
n two "Hello, seme
and
numbes_andprint of
chaadtr python
Engineering
woald hame
!";
pograj
and
count
print &
Technology,
téY Hele
a
gien
sum,
esage
ating PILANI
Qutputa5
aiaThe
c7
BK
() Birla
print('Te
(s*(s-a) (nput('ntes
Cfoat(
ana btc)2
S(at b=
fleat.a- veeading
shapl
inputcincle) [n]+=l
else :dict
prtnt(charg
uery'gAcaoogle.cometwundict Institute
(Enter
float((
input
mput a of
(sH*(s-) ( gien Engineering
Enkx
iangk shape(ucanye,
thizsecond fistside )
dside&
proprak
valgomus &
is o. side ) Technology.
5
o
4'aa) 0. )
triang
PILANI
and
The entryThe enty
Next Oops,
eeiprocal is2
class
'2evoDivisian
2a
0.5
Esvo
'>ocruud
BK
M3.
(b).Handle Birla
a)Pnnt
break
cxapt 8. tten 0;
byi entyrandom
for importsys nt
main)Lsiny # Jead Run
pi("Next
entry")
pril("Dops! cnn, ,ninit includo Institute
pziri( ) H/int
(entey)
primt"The coutd'"Hello.
Woro\m3
List diided namypacestd; somepytfona
in8
xadomlst-['a', (iostr fom
namentimes, of
hy eam) inpul, Engineering
ertry 0,
sys 2] Zero
s' woipgsarn
ng
excmfol)
ertry) ezuphm.
for whwLTechnology. &
[o"accurcd and nam an
f
whilk ike
and
&
PILANI
loops. n
)
ve
Qutaut
Enttrfle Datpat
i
d:h:m:STnput
Jumber
ime
’
of
name
catal,txt |4;6:56 in
lines?
seeonds
1 5
:
1234
565
BK
() Birla
print(nunlines)
point("Number -.widhnum-
ines 0 (ount
each
in. d). hous
frame Read pint(seCons
time60 day ime Pint Institute
seionds.i0
lines
+=|
r)asf8
num nane,
opon a "dah& iu time lot cwed
input(" fle l Il ( of
36
(293600) input Engineering
line ma 00
Ente u
S’ tim("Irput ne
lines")8 by
fox
file od o=
ne imu IO
360O &
name8 ) od: ime tswith
and = Technology.
minuss tiu
print od second; in
s yo
=(24
mindes, d fm
thuseords)
/(day, "3500) ? intrsval n
II "))
PILANI
word 60
tirna
hout, ,
BK Birla Institute of Engineering & Technology. PILAN!
xpeximnt -TV
Mt. @ight an LED hrough yhom pogramß.
In Raspbevy
A Bsceadboaud
fi sunning kaspbiarn,
An.LED
A330 ohm...esis tor
ode 8
import Rit GPIO.as
import time
GflQ.setmode(G PIO. BCM)
hPlC. sctwoinga (False)
aPlO. setup(18, GPIO. 00T)
print"LED on"
GPlo. output (18, GPIO. HlGaH)
Hima, sleepi)
print "lED
aPI0. output(i8, GPIQ.LOw)
(b)yt înput rom two swi tches and suitch an
caupondirne LEDs.
Cormponeny
Raspbey R.
Breadboad
*
LED
J*Buton.
Junper wincs
BK Birla institute of Engineering &Technology, PILANI
StepI8 Buils tie Circuit
StepllaChange iuctory and wuitethe prgr an
Python,
#uso/ bin/ env python kfpet
impost RP. GPIo as GPIo
impat time
ted Pin>|!
Btn Pin=/2
led_status =l
def sekup);
GaPlO.setmode( GPlO, BOA RD)
GPI0. setupl ledPin, GPlo. oUT)
GPlo.schypl Bin Pin, Ga Pr0. INypulupdoum- GPIO. PuD
GPIO. ouput(ledPin, GPI0. HIGH) UP)
def suled (=None8
qlobal led-status
led-status = not ledstatus
GPIO.outputl Led Pin, Ledstahus)
-iled-status. = = la
print led of
else i
pRt print.. ed on'
def loapl:
BK Birla Institute of Engineering & Technology. PILANI
Components rcquired i
oneled
l00 ohm usiston
Jumper ables
inport tane
impatRli GPIOao GPIO
GPIO. sehnode GPIO. BOARD)
GPIC. setup( ll, GPIO. oUT)
whileTauc6.
BK Birla Institute of Engineering &Technology, PILANI