Showing posts with label Testing. Show all posts
Showing posts with label Testing. Show all posts

Thursday, April 28, 2011

I2C

I2C inter micro controller communication

First experiment, failed !!! The problem : Grounds were not connected together !!!

Second experiment, Succeeded :-)

I2C connection between one master Arduino & one Slave Arduino over a serial clock pin (SCL, pin number 4 in the picture down here, YELLOW wire) that the Arduino pulses at a regular interval, and a serial data pin (SDA, Pin number 5 in the picture down here, RED wire) over which data is sent between the two devices. Also make sure that the grounds are connected together.


Master Writer Code - Program for Arduino 1

// Wire Master Writer
// by Nicholas Zambetti 

// Demonstrates use of the Wire library
// Writes data to an I2C/TWI slave device
// Refer to the "Wire Slave Receiver" example for use with this

// Created 29 March 2006

// This example code is in the public domain.


#include 

void setup()
{
  Wire.begin(); // join i2c bus (address optional for master)
}

byte x = 0;

void loop()
{
  Wire.beginTransmission(4); // transmit to device #4
  Wire.send("x is ");        // sends five bytes
  Wire.send(x);              // sends one byte  
  Wire.endTransmission();    // stop transmitting

  x++;
  delay(500);
}


Slave Receiver Code - Program for Arduino 2



// Wire Slave Receiver
// by Nicholas Zambetti 

// Demonstrates use of the Wire library
// Receives data as an I2C/TWI slave device
// Refer to the "Wire Master Writer" example for use with this

// Created 29 March 2006

// This example code is in the public domain.


#include 

void setup()
{
  Wire.begin(4);                // join i2c bus with address #4
  Wire.onReceive(receiveEvent); // register event
  Serial.begin(9600);           // start serial for output
}

void loop()
{
  delay(100);
}

// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void receiveEvent(int howMany)
{
  while(1 < Wire.available()) // loop through all but the last
  {
    char c = Wire.receive(); // receive byte as a character
    Serial.print(c);         // print the character
  }
  int x = Wire.receive();    // receive byte as an integer
  Serial.println(x);         // print the integer
}



Source : http://arduino.cc/en/Tutorial/MasterWriter

Thursday, February 17, 2011

Test units(JUnit) on the way ...

Today I got some tips from a very experienced programmer who is a team leader at a leading IT consulting company here at Norway. He advised to me to no matter what have test codes in my java code. No matter what use a version control system and have a structure in my coding. I think as long as I am so keen of having things planned and well-structured I would do implement his ideas into my master thesis to have a much clear expectation from myself and be able to plan better my way ahead. I think this would also give me the chance to do implement white box testing on my code and of-course more things to write about :-)

Friday, June 11, 2010

Category-partition Testing

Testing, Verification & Validation
X Robot families

INF4290
Semester Project Report
Title : Testing of a X family Robots
Akbar Faghihi Moghaddam - (Shahab)


TABLE OF CONTENTS
  1. INTRODUCTION
  2. BACKGROUND
  3. DESIGN OF CASE STUDY
    1. The SUT
    2. The System Specification
    3. Testing Phase
      1. Enable / Disable Motor
      2. Restart
      3. Rotation of the robot arm
        1. Base Choice(BC)
        2. Each Choice(EC)
        3. All combinations (AC)
  4. ANALYSIS OF THE RESULT
  5. LESSONS LEARNED AND OPEN ISSUES
  6. REFERENCES