Showing posts with label XMOS. Show all posts
Showing posts with label XMOS. Show all posts

Monday, May 30, 2011

Final report

The final report was due today. This is the last document that was written for the project. It contains an overview of all requirements that were implemented and how they were implemented.

This project was also added on the XCore website. Its page can be found here. The source code can also be downloaded there.

Jasper


Final report

Tuesday, November 30, 2010

First Robot

After some time, I've built a first completely wireless robot.
It uses a wireless XBee connection to send the commands.
It will move for 4 seconds and then stop for 4 seconds before moving 4 seconds and so on.

Here is a video:

The code is very basic, it uses the UART example provided with the XMOS development environment.

This is the code that receives the data sent by an Arduino with XBee module on top.

void rxByte (in port RXD, chanend c){
 unsigned byte;
 unsigned time;
 char val;

 // Wait for start bit
 RXD when pinseq (0) :> void @ time;
 time += BIT_TIME / 2;

 // Input data bits
 for (int i = 0; i < 8; i++) {
  time += BIT_TIME;
  RXD @ time :> >> byte;
 }

 // Input stop bit
 time += BIT_TIME;
 RXD @ time :> void;

 // Send received character to listener to perform associated action
 c <: val;
}
This is the code that sends the data.   
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.print('H');
  delay(1000);
  Serial.print('L');
  delay(1000);
}