Show Posts
Pages: 1 2 [3] 4 5
31  Using Arduino / Programming Questions / Re: Interesting discovery - Can you figure out what's wrong? on: June 29, 2013, 05:34:40 pm
As an aside, the String class you use in your example can also be problematic since it exposes a heap corruption problem in versions up to 1.0.4 and introduces the risk of heap fragmentation in all versions. In a system with such limited heap space and such limited ability to manage the heap, using dynamic (heap) memory to store dynamic data is not a smart approach. I recommend that you use c-strings (null-terminated char arrays) instead. There are no particular advantages to using the String class and IMO you would be better off forgetting that it exists.

Peter, String has a huge advantages... smiley It prevents a huge amount of frustration.

The function I am working on will generate GCode commands.. I just want to build simple string but I am finding it hard to even just add a char to char *.  smiley-eek-blue
32  Using Arduino / Programming Questions / Re: Interesting discovery - Can you figure out what's wrong? on: June 29, 2013, 04:28:49 pm
Thanks for all the info...

I turned on verbose output and it pointed out some useful stuff. Also cleared up a few things I wondered about.

Regarding the String class, I do agree that its not the best way to go. My first thought was actually that using String was
causing the lock-ups.  smiley-grin

33  Using Arduino / Programming Questions / Re: Interesting discovery - Can you figure out what's wrong? on: June 29, 2013, 05:32:22 am
We deal with arduinos here not controllers/pics/pis/ ect.

I see... So an Arduino's not a Micro controller then?

But thanks for the friendly greetings and advice. smiley-wink

Just want to point out that its worth ensuring all your code paths return values. In this case, the second "if" did not return a value at all times causing my Arduino "Micro Controller" to lock up.
(The IDE also doesn't warn you of this issue)

Exception handling would be nice for this, but too resource intensive for a MCU I take it..
34  Using Arduino / Programming Questions / Interesting discovery - Can you figure out what's wrong? on: June 29, 2013, 05:06:04 am
  String test(char A,int C, String R)
  {
    if(C > 10)
      return A + R;
    else if(C < -10)
      return A + "-" + R;
  }

Notice  anything wrong?

This code causes my controller lock-up...
35  Using Arduino / Sensors / Re: Motor Shaft position tracking - Would an optical mouse sensor work? on: June 27, 2013, 10:17:40 pm
http://www.digikey.com/us/en/ph/cui/amt.html

AMT 100 series is an incremental encoder, 2048 PPR. It also includes an index position so you can zero it. Starting at $24 they're pretty hard to beat.

Thanks for that... that sounds exactly like what I need.

Would an Arduino be able to read those pulses though? 2048PPR x 1000rpm (or 17rps x 2048 or 35Khz I think + plus reporting the results via I2C every few seconds.)

 
36  Using Arduino / Sensors / Motor Shaft position tracking - Would an optical mouse sensor work? on: June 27, 2013, 04:28:51 am
Hi All,

I am looking into tracking the position of a motor's shaft. It needs to be fairly accurate at about 0.2 - 0.1 degree intervals.

There are commercial optical sensors but they are really expensive ranging from $50-100. A mouse's sensor should be able to
do the job,right?

A good optical mouse would can do around 1600 DPI. Having a rotating disk on the shaft that the sensor can scan that has a
diameter of over on inch should make it with in the mouses range,right?

Sorry for all the questions. Any information on the topic will be appreciated.

Thanks.
37  Using Arduino / Sensors / Optical Mouse Sensor Supplier on: June 27, 2013, 04:22:15 am
Hi All,

I have been looking around for suppliers of Optical Mouse sensors that I can use for an Arduino project. Not having any luck at this stage...

Sparkfun use to have a kit but the sensor has been discontinued. Had a look on Digi-key but they want you to call them if you want to order some.

Any ware else I could look?

I am not even sure if you call it Optical Mouse sensor... Any information would be appreciated. Thanks.
38  Using Arduino / Microcontrollers / Re: Upload Sketch using ISP - Is possible ? on: June 23, 2013, 02:11:31 am
Your error screen is saying :    Using Programmer              : stk500v1

did you use File > Upload Using Programmer ?

And not the upload button...
39  Using Arduino / Microcontrollers / Re: Arduino Due on a Breadboard? on: June 23, 2013, 12:56:44 am
Why didn't you just say so...  smiley-lol

At that price its well worth it and its breadboard friendly.

Here is the schematics if you want to build it your self: http://www.pjrc.com/teensy/schematic.html
40  Using Arduino / Microcontrollers / Re: Upload Sketch using ISP - Is possible ? on: June 23, 2013, 12:52:06 am
Thanks guys...

I have it all going now. It was just getting the order of the steps correct,when doing it all through the Arduino IDE.

Nick's work is very useful and I will keep it in mind if I want to make a mobile programmer to upload code to multiple MCU's.
(You are right OptiLoader and Adafruit extensions for it are similar solutions. )
41  Using Arduino / Microcontrollers / Re: Upload Sketch using ISP - Is possible ? on: June 22, 2013, 05:23:13 pm
Yes... I have not had this issue with my Atmel programmer.

But I am working on a shield with a ATMega on it and I wanted to program it from the main Arduino with out the need of a programmer and to have to remove the MCU from the Arduino Board.

I am still ironing out the process but I can definitely say that : Uploading a Sketch using ArduinoISP is possible. (Original thread topic.)
42  Using Arduino / Microcontrollers / Re: Upload Sketch using ISP - Is possible ? on: June 22, 2013, 04:39:30 pm
You should only need to burn the bootloader once, to get the fuses set up.
After that, File:Upload Using Programmer should be sufficient to load the sketch with no bootloader.
Or File:Upload for sketch upload via serial port using the bootloader.

Mmmm... I am having some inconsistencies. It seems that I need to upload the sketch twice before it sticks. (That might be why writing the bootloader seemed like it was needed at first.)

At least I now have a method to consistently upload sketches.
43  Using Arduino / Microcontrollers / Re: Arduino Due on a Breadboard? on: June 22, 2013, 03:34:21 pm
Not sure how this would help me out.  I want an ARM based MCU and this line doesnt seem to support so.  If only the DUE would have DIP package smiley-sad

I had a look at a 120pin DIP MCU the other day and it was huge!!! Was over 150mm long.

Have you considered looking at SAM3N? They are the same family as the Due's SAM3X but comes with less features and less pins...  smiley-mr-green
44  Using Arduino / Microcontrollers / Re: Upload Sketch using ISP - Is possible ? on: June 22, 2013, 03:28:15 pm
For me this worked:

- Connect the Arduino that will do the programming.
- Upload the ArduinoISP sketch to it.
- Connect the wires from the Arduino with ArduinoISP on to the target board/Micro controller you want to program. (Remember that the Pin 10 from the ARduinoISP goes to the targets boards reset pin, not the ICSP header)
- In the Arduino IDE select the Target Board. Tools - > Board ->  Board type you are targeting
- Set the ArduiniISP as the programmer. Tools -> Programmer - > ArduinoISP
- The part I kept on missing was that you need to then burn the boot loader. Tools -> Burn Bootloader.
- Open the sketch that you want to upload to the target board.
- Upload the sketch to the target board by clicking on File - > Upload Using Programmer.

That worked for me on Arduino IDE 1.03 with two Arduino Duemilanove boards.

Keep in mind that the ArduinoISP method acts like a real MCU programmer that clears the MCU and overwrites the bootloader every time. So you need to Burn the Bootloader before uploading the sketch.

Hope this helps.
45  Using Arduino / Microcontrollers / Re: Upload Sketch using ISP - Is possible ? on: June 21, 2013, 11:24:13 pm
Ayup.  Upload using Programmer will erase the bootloader.  Glad you figured it out.

That was the missing step in the list above. For me to program the second MCU over and over I had to burn the bootloader each time before uploading the sketch I wanted on it.

I am using 2 arduino duemilanove by the way.
Pages: 1 2 [3] 4 5