Wednesday, 2 March 2016

Computing 03/03/16 ipconfig

When connected to a network, ip address is assigned to the device. On computer, we can open up cmd and type in " ipconfig " to find out the ip address . For Raspberry pi, we can type in " ifconfig " into the terminal to find out the ip address.  

We can type " ping __(ip address)__ " to find out the connection speed between us and another network by telling the strength, distance, and availability of the connection.

Download Putty from www.putty.org and by default port will be 22 so do not change it. Type in the ip address of the raspberry pi to connect your laptop to the raspberry pi and control it using the laptop. Both devices must be connected to the same Wifi .

Default account for raspberry pi is always:
User name: pi
Password: raspberry

Highest number of ip address is 255.255.255.255, in binary number will be 11111111.11111111.11111111.11111111. Smallest will be 0.0.0.0. There are 4,000,000,000 IP numbers in total In Singapore, most of us will have an ip address of 192.168.__.__ .



Reflection:
I think that it is very interesting to learn about ip address and connect devices together by using the ip address. Some games can also be connected by connecting to same wifi network and using ip address so it will be quite fun to be able to play the games with friends.

Friday, 26 February 2016

Computing lesson 18/2 LOOP


25 February



Firstly, I have learnt how to set up raspberry pi as a desktop and it is Linux and also learnt the commands of raspberry pi.

Next, I have learnt about loop. There is function of factorial and function sum_up_to_n. There are two ways to type the range.    For both, we first have to define factorial n by typing “def fac(n):” or define sum_up_to_n by typing “def sum_up_to_n (n):”. A colon must be added at the end.  We will have to type result = 1 for factorial or result = 0 for sum_up_to_n since factorial cannot have 0 being multiplied as answers will always be 0.   One way is to type “for I in range (1, n+1):”  while the other is “ while ( i <= n ):”     The last step will be to type “return result” and then print the n number that we want to insert in.