Bits and Bytes

August 4, 2011 Leave a comment

Before  start my communication programs , it would be worth reminding few “bits” operation:

Description:

Number – input value

x – bit position

<<, >> – bit shift left and right

Let’s start

Set (1) one bit inside byte:

OUT = Number  OR  1 <<  x

Clear (0) one bit inside byte:

OUT = Number AND Not (1 <<x)

Checking a bit

OUT = Number >> x  AND 1

Out will be ”1″ or “0″

I used logic gates:OR, AND, NOT

 

 

 

 

 

 

 

 

 

 

 

 

Lastly short Arduino program

show number as 1010… format

void Printbyte(int in) 
{
  for(int x = 8;x>0;x--) {
    if(( (in>>(x-1)) & 1 )== true) {
      lcd.print("1");}
      else {lcd.print("0");
      }
    }

}

Connection

August 3, 2011 Leave a comment

Most important thing is good and fast enough link between ROV and remote system.

This is my idea :

Description:

Gray box “converter” – arduino uno with I2C Bus Extender (up to 30 meters)

PC  side -> serial connection via USB with a ” converter”

ROV as Master on I2C Bus “converter” will be Slave

Categories: Uncategorized Tags: , , , ,

Welcome !

August 3, 2011 Leave a comment

Hello World  !

My name is Marcin

Martin Rov Blog is about “how to build ROV in home” so I can  show  ideas, share my  programs, know hows etc..

I m still learning English so this blog will be  good way to improve it.

Categories: Uncategorized Tags: , , ,
Follow

Get every new post delivered to your Inbox.