Tuesday, 21 February 2012

Pointers.

Today I have learn about Pointers - because function can only return one data.

int i = 3; [address of variable : &i   = 65524]
             [value at address :     *(&i)  = 3 ]
             # the sign *( ) si called pointers.
declaring pointer - pointer variables:
int *alpha ;  //integer pointer
char *ch ;  // char pointer
float *s  ;  //float pointer

Example of call by reference:

void main (void)
{
int a = 10, b = 20;
swap (&a, &b);
printf ("a = %d, b=%d\n", a, b);
}
void swap ( int *x, int *y)
{
int t;
swap (&a, &b);
t=*x;
*x=*y;
*y=t;
}

And am doing some exercise :

Get radius, calculate area and parameter using one function only.

Also am doing this exercise :

Add caption

Thursday, 9 February 2012

Quiz.

Yesterday I'm doing some quiz on C Programming. The question is straight forward but for me when it comes to programming than I'll blank. I try to do it myself but then seriously I'm surrendered. Dr Zul helps me to understand it, and I know when there are others help you then you can do it. As I said, the question is very simple and Dr Zul taught me in a easy way to see it. Thank you Dr, I truly appreciated what you have done to me.
Then today, I have planned to do some exercise on Programming. Try and error. I hope that I can mastermind it. InsyaAllah.

Friday, 3 February 2012

Sensor. Again.

Today I just remembered that I have asked Mr.Badrol (Electrical Section) about the sensor. Then he gave me some opinion, he said why not I used obstacle detection sensor? It's simple and easy to use. I have Google a few about the sensor but I do not found something that I think suitable for the little robot. I have been thinking, what would I show to Dr. Zul then?
Later on, Kak Yati come into the office to show her project outcomes. Then Kak Yati using a circuit called IR01A Medium range Infrared Sensor produced by Cytron Technology. Dr Zul want me to check this out and I have found a few information about the infrared. Also, I have downloaded the user's manual and this is the link : http://www.cytron.com.my/usr_attachment/IR01A%20User%20Manual.pdf

This is the circuit.

Dr Zul said he will buy the circuit and he wants me to test the component until I get the actual result. InsyaAllah I'll try my best :)

Thursday, 2 February 2012

Find a Sensor.

A few days ago, Dr.Zul ask me to find a sensor to put to his little robot. He wants a sensor that can sense object in front of the robot. Then, I make some research and I found a few types of sensor which is proximity sensor, infrared, photoelectric distance sensor and etc.
A proximity sensor is a sensor able to detect the presence of nearby objects without any physical contact. The sensor often emits an electromagnetic field or beam of electromagnetic radiation (infrared, for instance), and looks for changes in the field or return signal. The object being sensed often referred to as the proximity sensor's target. Different proximity sensor targets demand different sensors. For example, a capacitive or photoelectric sensor might be suitable for a plastic target; an inductive proximity sensor always requires a metal target. The maximum distance that this sensor can detect is defined ''nominal range''. Some sensors have adjustments of the nominal range or means to report a graduated detection distance. I think, proximity sensor is not suitable for the mini robot, cause the sensor is big and the function of the sensor itself not suitable for my dear robot. (mine?)..
Then, I read a little bit about the photoelectric distance sensor, a photoelectric sensor, or photoeye, is a device used to detect the distance, absence, or presence of an object by using a light transmitter, often infrared, and a photoelectric receiver. They are used extensively in industrial manufacturing. There are three different functional types: opposed (a.k.a. through beam), retroreflective, and proximity-sensing (a.k.a. diffused). Thru on my reading, I think that the function between proximity and photoelectric sensor are similar. So, the photoelectric sensor also doesn't suitable for the robot. 
I was wondering how about car's sensor? Does it suitable for the robot? Then, I'll update later on car's sensor. Still searching for the info. :)