Friday, November 22, 2013

How to control termometer in Arduino

Today I'm going to show you how to control termometer. Firstly you will need to connect terometer to Arduino.

Now open your arduino! =)

void setup() //setup function
{
  Serial.begin(9600); //install Serial output
}

int checkTemp() //read temperature function
{
  float voltage = 0; //float variable for volts
  float celsius = 0; //float variable for celsius
  float sensor = 0;  //float variable for sensor
  
  sensor = analogRead(0); //read from analog input 0
  voltage = (sensor * 5000) / 1024; // convert raw sensor value to millivolts
  voltage = voltage - 500; // remove voltage offset
  
  return (voltage / 10); // convert millivolts to Celsius and return result
}

void loop() //loop function
{
    Serial.println(checkTemp()); //print result of checkTemp() function
}

Ok, now upload your code. And press tools->"Serial Monitor" or Ctrl + Shift + M. Done!

Our project - 25% done

We have done about 25% of our project.

 

 

 


 

Olso we started work on our source code =)

Thursday, November 14, 2013

Plans for future

    On robotics lesson we have started out own projects. My group and me decided to create Samon Says game. Now we are waiting for items to build our game and pretty soon we will start writing source code for our game. We have got alot of ideas how to modifie this game and make it as much as it possible better.
    When we will finish our project i will publish about it in my blog!

    P.S. If you too have got some ideas, which will be interesting to apply to our project - don't be shy! Share them with me!

Robatics convention

    We have been on robotics alley convention yesterday (11.13.13). There we have seen alot of different robots and ideas, which will be very interesting to realize in future for us. There we have seen such robots as baseball player robot, Frisbee thrower robot, football player robot. For me the most interesting robot was robot, which was scanning table with full bunch of sweets and give you one with flavour you have chosen.

    We have earned alot of ideas which will be very useful and interesting realize for us.

Sunday, November 3, 2013

Arduino coding and functions

   What is functions? Why do we need to use them? Now I will explain it to you!

  OK, let's with little introduction. I have found website with very good explanation, if you want to learn more about them, it will be good idea to visit it
  We need to use functions to make our program easyer and more complicated.

Syntax of functions:

type_of_function name_of_function(variables(input) if needed)

    //do staff
    return value; //if needed
}

And now, how to call(execute it):
Form another function.

void loop()
{
    name_of_function(variables(input) if needed);
}

Now I will show you a little example:

void setup()
{
    digitalPin(13, OUTPUT);
}

void bLED()
{
    digitalWrite(13, HIGH);
    delay(200);
    digitalWrite(13, LOW);
}

void loop()
{
    bLED();
}

If you have got some questions, fell free to ask me.