Show Posts
Pages: 1 ... 464 465 [466] 467 468 ... 958
6976  Using Arduino / Interfacing w/ Software on the Computer / Re: debugging a serial communication tool on: November 09, 2012, 01:03:08 pm
This does not look like arduino code ...

what I see is that the fd is nowhere closed

n =  write(fd, load, m);
what is n after the statement, it should be equal to m ...
6977  Community / Exhibition / Gallery / Re: SRF01 Ultrasonic Range Finder Working Code on: November 09, 2012, 12:57:04 pm
Thanks,

could be the beginning of a library ...
6978  General Category / General Discussion / Re: Clock Clock on: November 09, 2012, 12:54:18 pm
They are geared separate I think, but they are synchronized quite well.

I like the fractal concept in it. clocks at 2 levels.
6979  Topics / Robotics / Re: Wheel encoder interrupts on: November 09, 2012, 12:40:38 pm
can you disconnect the servo's and try manually?
The servo's may send noise.

What are you using to power the servo's?
6980  Topics / Robotics / Re: Wheel encoder interrupts on: November 09, 2012, 12:39:24 pm
Quote
The  signal line is pulled low by the encoder when it gets a reflection and allowed to float otherwise so I have put 10K pull-up resistors on the signal lines as per the manufacturers instructions.
Sounds OK,

Can you post the (partial) output of the script?
6981  Topics / Robotics / Re: Wheel encoder interrupts on: November 09, 2012, 11:11:52 am
if the ints overflow fast it can have side effects

change

volatile int Rindex = 0;
volatile int Lindex = 0;

in
volatile unsigned long Rindex = 0;
volatile unsigned long Lindex = 0;

then it will takes far longer before overflow ...

do you have pull-down resistors on the irq lines?
6982  Using Arduino / Installation & Troubleshooting / Re: Sketch will not run on: November 09, 2012, 11:05:33 am

please post your sketch (use the # button for code tags) and your schematic, then we can have a look!
6983  International / Nederlands / Re: Koop, download,installeer, advies on: November 09, 2012, 10:05:53 am
komt de arduino buiten te staan of binnen?
6984  Topics / Robotics / Re: Wheel encoder interrupts on: November 09, 2012, 10:03:55 am
some patches to your code
Code:
#include <Servo.h>
Servo servoRight;
Servo servoLeft;
volatile int Rindex = 0;
volatile int Lindex = 0;

void setup()                                 
{
  attachInterrupt(0, rtEncoderInterrupt,RISING);
  attachInterrupt(1, ltEncoderInterrupt,RISING);

  Serial.begin(115200); // why not faster ???

  servoRight.attach(12);
  servoLeft.attach(11);
  servoRight.writeMicroseconds(1700);
  servoLeft.writeMicroseconds(1300);
}
void loop()
{   
  Serial.print(Rindex); 
  Serial.print("          ");
  Serial.println(Lindex);

  // stop the servos after 16 interrupts from either  encoder
  if((Rindex >= 16) || (Lindex >= 16))  // you may just miss ==
  {
    servoRight.writeMicroseconds(1500);
    servoLeft.writeMicroseconds(1500);
  }
  // hold execution here
   while((Rindex >= 16)||(Lindex >= 16)){}   
}

void rtEncoderInterrupt()
{
  Rindex++;
}
void ltEncoderInterrupt()
{
  Lindex++;
}
6985  Topics / Robotics / Re: Wheel encoder interrupts on: November 09, 2012, 10:00:36 am

dont do serial prints in an interrupt. They should be as short as possible
6986  Using Arduino / Programming Questions / Re: Speed of floating point operations on: November 09, 2012, 09:53:09 am
Quote
Which all goes to show what a nonsense measuring the performance and optimization of contrived sequences of code is.

If you have a real application - then it gets interesting.

Agree with you unless your goal is to learn about optimizations and how they are done. (there is always that other option smiley-wink
6987  Using Arduino / Project Guidance / Re: How to make Reliable Serial communication on: November 09, 2012, 09:48:45 am

use start characters and stop characters and occasionally a checksum (e.g. CRC ) to detect begin and end of messages and the correctness of the communication.

if you really want to dig into it - http://en.wikibooks.org/wiki/Serial_Programming/Complete_Wikibook - is a extended reader
6988  Using Arduino / Sensors / Re: [strange problem] ADT75 temperature sensor on i2c on: November 09, 2012, 09:43:19 am
HI Carsten,

what happens if you only connect the "failing" one does it show the same behaviour?

Do you have a link to the datasheet of teh ADT75? there might be a reset command? never give up hope smiley
6989  Using Arduino / Sensors / Re: Atlas Scientific pH stamp with arduino on: November 09, 2012, 09:41:16 am
some answers can be found here - http://arduino.cc/forum/index.php/topic,104096.0.html -
6990  Using Arduino / Sensors / Re: Atlas Scientific pH Stamp Issue on: November 09, 2012, 09:39:05 am

The code tags are done with the # button just above the smileys ...

Quote
but how do i display the pH values on LCD?
There is an example here - http://arduino.cc/en/Reference/LiquidCrystalConstructor - it is not difficult to merge with your sketch.

You might need one of the other functions of the LCD lib - http://arduino.cc/en/Reference/LiquidCrystal -

Pages: 1 ... 464 465 [466] 467 468 ... 958