Show Posts
Pages: 1 2 [3] 4 5 ... 20
31  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: AVR Bootloader burn error in Arduino 9 and 10 on: November 18, 2007, 11:16:46 pm
well i did burn my first bootloaders under AVR Studio and it was _much_ faster. is there any way to speed it up from within arduino? or do you recommend using AVR studio? i don't really mind the ten minutes for the handful burns that i do.

ps:

how does the board-selection in version 0010 work? i can't get the Diecimila bootloader burned on an atmega168 (inside an arduinoNG). burning completes successfully, but the chip is useless. it just continously blink on pin13. if i select the ArduinoNG as a board and bootloader everything works fine. just with the old bootloader, which doesn't timeout on invalid data, or does it?
with version 0009 i had no problems burning each with the same hardware setup!?

//kuk
32  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: AVR Bootloader burn error in Arduino 9 and 10 on: November 18, 2007, 03:04:50 pm
just wanted to throw in that i'm successfully burning bootloaders to atmega168s using an mkII + an arduinoNG on an Intel Macbook running 10.4.9
thank you very much for this feature. if it does not work for anyone and you're sure that your mkii is not dead, check those 3 things mentioned before:

- arduino has to get power from an external source (wall plug)
- set the power source jumper on your arduino accordingly
- plug-in the ICSP-cable correctly.

if the programmers shows the green light (instead of red or orange or blinking or something ) the hardware part should be fine. Start the arduino application _now_ and begin burning your bootloader (or sketch soon :-).

the arduino app seemed frozen when i did it the first times, not telling me something new for a couple of minutes, just a "burning bootloader". the process takes something like 5-10 minutes on this machine, but it works. After some lightshow, the programmer shows the green light again, and arduino tells me "Done burning bootloader". No other messages in between, which you just have to know.



33  Forum 2005-2010 (read only) / Syntax & Programs / Re: Creating cordinates using piezo microphone on: September 23, 2008, 04:00:02 am
found what i was talking about earlier:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1196329716,
still very impressing to me, but don't know if he ever finished it.

kuk

34  Forum 2005-2010 (read only) / Syntax & Programs / Re: Creating cordinates using piezo microphone on: September 18, 2008, 03:11:24 pm
some time ago someone posted about some kind of shooting targets (gun or rifle shooting that is). if i remember correctly he used 4 microphones and a little math to calculate the coordiantes of a hit.
the target area was a little larger than a cd though (like 1x1m?) PLUS his sound waves travelled through air which makes them like 8 times slower than through the plastic of a cd.

sound travels a little faster than 300m/second in air. that's about 30cm in a milliSecond, or still 0.3mm in a microSecond. for plastics the speed usually is higher than 2000meters/second.

as mem put it: this is tricky if not impossible with your pictured setup.

good luck though.



//kuk


35  Forum 2005-2010 (read only) / Syntax & Programs / Re: lcd serial interrupts servo cycle on: April 24, 2008, 04:02:13 am
hi,

when is your "header byte (~)" sent? if it's only at the beginning of a new serial message, it's clear why your servo won't do anyting after the first message is sent. i'm not sure if i understand your problem and code correctly. but maybe replace

Code:
while (charIn != 126) {
...
}
with something like

Code:
while (charIn != 126 && nextByte()) {
...
}

i didn't test this, but the idea is to leave the while loop when the serial message is over. not when the next message starts.

36  Forum 2005-2010 (read only) / Syntax & Programs / Re: bizarre restart bug: calling arduino ninjas. on: February 28, 2008, 09:41:57 am
Quote
P.S. Too bad I didn't find the fix for you tho, would've liked a RepRap printed item--particularly if it was another RepRap. :-)
me too :-)

and thanks as well for letting us know about the interrupt. this rang a bell for me concerning probs with an older project.  :o


37  Forum 2005-2010 (read only) / Syntax & Programs / Re: bizarre restart bug: calling arduino ninjas. on: February 19, 2008, 02:39:32 pm
Hej Hoeken,

first of all, i tried getting into your code. really. but it's just too much, and way too abstract without being able to try out what it really does. But anyway, and in hope i'm not writing stuff you already tried a hundered times:

You wrote the problem only affects the Y-axis. So i'd try anything to get the bug show up for another axis now.

- you probably already swapped the motor boards, and the bug still showed up for only the y-motor!? (yeah, i know, the bug still happens with no board connected...)

- did you change the motors pin numbers numbers instead of the motor connections? (maybe the bug is connected to a certain pin number?)

- did you write the libaries from scratch? could there be a pin conflict?

- is there anything else special to the y-axis, compared to x and z? any special move, length or delay?

I think Mellis' guess sounds very resonable except that it doesn't explain the y-axis-phenomenon.

Quote
...
I dont think its a brown-out reset, because the arduino doesnt  hit the bootloader... it goes straight to the beginning.  Not only that, but I have a random movement tester that works 100% fine with the boards... no resets. (also, the bug happens with the stepper boards unconnected!)
what's a random movement tester? a board to test sub boards without the arduino? or a seperate program for the arduino?
concerning brown-out, i think there are differently behaving bootloaders and configs out there. i'm currently using a ladyada version which only starts the bootloader after a manual reset. just maybe that rings a bell...

so that was my shot at it.
good luck,
kuk


38  Forum 2005-2010 (read only) / Syntax & Programs / Re: pid on: January 30, 2008, 02:34:25 pm
hi axileon,
maybe you should be more specific on what you're doing and how you're doing it. maybe some code or a drawing. it's really hard to tell why your setup isn't "fast enough" like this. is it almost fast enough or does it take like 50 seconds to update the position?
depending on how far you are with the whole project, it might be an idea to concentrate on the adxrs300 first. it's well documented and (so i read) much more precise than your idg300. i've worked with neither of them though.

how are you using the interrupts to pulse the servos? without really understanding what you do, it sounds like your interrupts are called too often. so that your loop never gets executed.

i'm not sure neither, if you need interrupts at all to do what you want.

best, kuk

39  Forum 2005-2010 (read only) / Syntax & Programs / WORKS: default arguments on: January 26, 2008, 09:10:56 am
hey all,
tested it on a board and it works!
as suggested define default arguments in the function prototype instead of definition.

code:
Code:

int blink(int i=1); //"blink" prototype (tested for i=0 and i=1 )


void setup() {
  //blink once to say hello
  digitalWrite(13,1);
  delay(500);
  digitalWrite(13,0);
  delay(500);
}

void loop() {
  blink(); // "blink" called without an argument
}

int blink(int i) { //"blink" definition
  digitalWrite(13,i);
  delay(500);
  digitalWrite(13,0);
  delay(500);
}

kuk
40  Forum 2005-2010 (read only) / Syntax & Programs / Re: default arguments on: January 22, 2008, 03:19:14 pm
Hi, i was wondering about default arguments as well. Thanks for the explanation mem!
To explain what prototypes are and what they're useful for (i had no idea about the latter):
Excerpt from the wikipedia http://en.wikipedia.org/wiki/Function_prototype:
Code:
#include <stdio.h>
 
 /*
  * If this prototype is provided, the compiler will catch the error
  * in main(). If it is omitted, then the error will go unnoticed.
  */
 int fac(int n);              /* Prototype */
 
 int main() {                 /* Calling function */
     printf("%d\n", fac());   /* ERROR: fac is missing an argument! */
     return 0;
 }
 
 int fac(int n) {             /* Called function  */
     if (n == 0) {
         return 1;
     }
     else {
         return n * fac(n - 1);
     }
 }
Quote
The function "fac" expects an integer argument to be on the stack when it is called. If the prototype is omitted, the compiler will have no way of enforcing this and "fac" will end up operating on some other datum on the stack (possibly a return address or the value of a variable that is currently not in scope). By including the function prototype, you inform the compiler that the function "fac" takes one integer argument and you enable the compiler to catch these kinds of errors.

www.arduino.cc/en/Hacking/BuildProcess says the following under "Transformations to the main sketch file":
Quote
... Next, the environment searches for function definitions within your main sketch file and prepends declarations (prototypes) for them to the top of your sketch. Note that these prototypes will appear before any type declarations or #include statements in your code, meaning that they cannot contain references to custom types.

It's unclear to me what the IDE does in case there is already a prototype for a function. I've no board here to test, but maybe you can define default arguments in a prototype on your own. that is, if the IDE does not overwrite them...something like this
Code:
void moveServo(int ServoPin, int PulseWidth, int time=0); //prototype
//...
void moveServe(int ServoPin, int PulseWidth, int time){
Serial.print(" #");
  Serial.print(ServoPin); //which servo to move
  Serial.print(" P ");
  Serial.print(PulseWidth); // the pulse width to send

  if (time != 0) {
    Serial.print(" T "); //temp command (time = 1 second)
    Serial.print(MoveTime);

  }

}

kuk






41  Forum 2005-2010 (read only) / Syntax & Programs / Re: Can Arduino produce 4 separate Sine Waves simu on: December 11, 2007, 04:55:28 am
Quote
Hi everyone,
Also, does anyone have any experience using lasers with photovaristors?  I'd like to modify my sine waves characteristics my subtly manipulating the amount of laser light the input receives, but am not sure if the standard photo components will work fine with laser light.
have a look here: http://home.earthlink.net/~lenyr/modlaser.htm
i got real good results until my laserpointer decided not to tolerate me fooling around with it anymore. i think results could be dependant on the wave length of the laser you're using. i used a standard cheap red from a laserpointer (650nm).

the frequency/light thing is exactly what i'm working on. getting multiple different squarewaves out of your arduino is a little tricky as you can't use the built in timers by default (like for PWM). There's a great library called FreqTimer2 in the playground which helps you doing this for one pin / one frequency. it basically takes one timer from the PWM functions and offers a convient way to create squarewaves with a fixed period.

in general this should be possible with more pins if you don't need PWM or other timing, i'm just getting into this timing thing. As Eberhard pointed out, precision depends very much on the maximum freq you need. This is even more true if you do this manually (that is writing arduino code to switch pins on and off). But if you only need to generate different squarewaves (not much more processing) you might want to try this out.

it might get hard though to measure precision in the higher audible range without an oscillograph or a similar professional tool. (my guitar tuner did not help here).

i hope this helped,
kuk

(edited.)
42  Forum 2005-2010 (read only) / Syntax & Programs / Re: OOP support on: November 13, 2007, 07:20:30 am
some arduino libraries are based on classes/objects. the syntax (standard c) should be available in simple sketches as well. haven't tried it though.

regards,
kuk
43  Forum 2005-2010 (read only) / Syntax & Programs / Re: C++ programs for sending command to RFID reade on: September 19, 2007, 04:41:53 pm
Quote
Uhhh your on the wrong site. This site is about the Arduino. smiley

hehe  smiley though i doubt that there is a dedicated V720S-BC5D4A-vs.-C++ forum anywhere on the internet.

@4may:
why does it have to be C++ from the start? just try to talk to the device using a serial port tool. select the port, speed and parity and send your commands. if the device (i have no experience with rfid-readers) does what you want it to do, you know that you're on the right way. the next thing to do would be finding a c++ forum, and (do a search first) ask there how to write commands to serial port.  

still there might be simpler solutions (for you) using some scripting language instead of c++. since your talking about com ports, i guess you're asking for a windows program/skript. you might even try to your luck with the arduino serial proxy application + flash.

there are readymade solutions out there. just search for them.

kuk

44  Forum 2005-2010 (read only) / Interfacing / Re: php Serial Class on: April 17, 2008, 02:27:46 pm
oooooh look what i've found in php_serial.class.php:
Code:
function phpSerial ()
      {
            setlocale(LC_ALL, "en_US");

            $sysname = php_uname();

            if (substr($sysname, 0, 5) === "Linux")
            {
                  $this->_os = "linux";

                  if($this->_exec("stty --version") === 0)
                  {
                        register_shutdown_function(array($this, "deviceClose"));
                  }
                  else
                  {
                        trigger_error("No stty availible, unable to run.", E_USER_ERROR);
                  }
            }
            elseif(substr($sysname, 0, 7) === "Windows")
            {
                  $this->_os = "windows";
                  register_shutdown_function(array($this, "deviceClose"));
            }
            else
            {
                  trigger_error("Host OS is neither linux nor windows, unable tu run.", E_USER_ERROR);
                  exit();
            }
      }

still doesn't explain why you get no error on OS X but, if we're talking about the same php class...

PS: i'm not very sure what these lines do except that they quit the script on an operating system which is not linux or windows... maybe just take out the ifs and try the linux code on OS X ... but that's just a shot in the dark, and you might be better off finding someone who documented doing this on a mac.
45  Forum 2005-2010 (read only) / Interfacing / Re: php Serial Class on: April 17, 2008, 02:16:21 pm
i've not worked yet with php_serial, but maybe it's just a user rights issue? how do you run your PHP in the terminal? you could also check the console for error messages.

best, kuk
Pages: 1 2 [3] 4 5 ... 20