Show Posts
Pages: 1 2 3 [4] 5 6 ... 9
46  Forum 2005-2010 (read only) / Troubleshooting / Re: Simple Stopwatch on: September 30, 2010, 03:42:49 pm
Maybe you need something like:

long ea = 133456;  
long totalSeconds = ea/1000; // 133s = 2minutes 13seconds
long seconds = totalSeconds%60; // 13 seconds
long displayLowSeconds = seconds%10; // 3
long displayHighSeconds = seconds/10;  // 1
long displayMinutes = totalSeconds/60; // 2

Hardcode a value for ea and Serial.print() the numbers to check your math. Once you workout the math, remove Serial.print().
47  Forum 2005-2010 (read only) / Troubleshooting / Re: Bootloader burning, bad signature,  -F on: October 16, 2010, 10:46:18 am
Burning an atmega168P-20PU from Mouser on a Mac w/ Arduino IDE v21, Arduino ISP results in:
avrdude: Expected signature for ATMEGA168 is 1E 94 06
         Double check chip, or use -F to override this check.

This thread states,
Quote
When I ordered the chips from Digikey, they came with the fuses set in the atmel default configuration which is DIFFERENT than what is set on the Arduinos (by default they are set to use the internal osc. instead of the external crystal on the arduino, they don't have the bootrst set, no brownout, etc).
So, when avrdude tries to read the device signature, the default 500kHz bitrate is too high, so you get back a garbage signature (sometimes it gets lucky and it read correctly, but mostly it was just garbage)
You have to lower the mkII's ISP freq to a speed supported by the default chips, fix the fuse settings, and then crank the speed back up on the mkII.  Once you do that the chips work fine with the Arduino environment.  I've been programming them all afternoon without hitch.

This implies the issue is likely with the bitrate. Is the way to solve this to change the bitrate via avrdude or AVR studio? Would an external oscillator help? Do any of the chips from Mouser or Digikey have this set right?
48  Forum 2005-2010 (read only) / Troubleshooting / Re: 2 servos controlled with mouse in processing on: June 11, 2010, 09:55:39 pm
Switching the motors was smart. You proved the motor is wired right. Of course there could be some issue with pin 10 or using two adjacent pins.

The next clever thing to do is run the sketch from the Arduino serial monitor. Also have the sketch echo back what it is doing:
case 'w':
         Serial.write("servo2.write("); Serial.write(v);Serial.writeln(");
        servo2.write(v);
        v = 0;
        break;

Think of testing with the serial monitor as unit testing the Arduino sketch. You want to make sure that works as expected before introducing Processing. Check that the servo is attached to pin 10 and the value in Serial.write(v).

After this, I would try a different port or a different servo library. Define the ports at the top of your sketch so you can  change them easily. But first make sure your Arduino and the library supports pwm on the pin. Early versions of Servo only supported pins 9 and 10.
49  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Better Arduino Switch Example on: September 30, 2010, 09:35:08 pm
Mellis's code is better, because it debounces. Though adding 'counts' or double click functionality is a good idea.
50  Forum 2005-2010 (read only) / Syntax & Programs / Re: newb help request.  How best to construct this? on: November 05, 2010, 10:06:27 pm
Dude, Just try to wirite it. First look at a real sketch like the blink example: http://www.arduino.cc/en/Tutorial/Blink

Make sure you can run the sketch. Trust me, it will be fun. Play with the sketch and run again (like change how fast it blnks.)

Add some print statements like when you turn the led on or off, Serial.println("led on"); The print statements allow you to see easilly what the program is doing. Look up: http://arduino.cc/en/Serial/Print

Now that you have learned a little Arduino programming, Add a few lines at a time to the blink example (and save under a new name) to get it to do what you want.
51  Forum 2005-2010 (read only) / Interfacing / Re: grid based navigation using ultrasonic sensor on: October 09, 2010, 10:32:19 pm
Please post if you make any progress. I'm going to try too, as it sounds so interesting. It will probably take me a couple weeks to get bluetooth and a beacon working.

Wireless, a beacon and a touch sensor seem like a good way to start. The wireless lets you monitor progress remotely, graph it with processing and do calculations on your PC. The homing beacon allows the bot to home every few minutes to a known position. Homing provides feedback for correcting the bots dead reckoning and improving the maps, i.e. it allows it's navigation to be self correcting.
52  Forum 2005-2010 (read only) / Interfacing / Re: grid based navigation using ultrasonic sensor on: October 08, 2010, 01:20:33 pm
I've been thinking about doing this too.

Object detection with wheel encoders seem like the place to start. At least you could map a room with good floors (no slippage).

Ultrasound is only good for object detection or avoidance. Touch sensors are probably needed too. Like what if the bot gets stuck behind a 1" high wall? The ultrasound may not be needed, but your mechanical/sensor design needs robust object detection. It could be just big bumpers front and back with touch sensors. Stall detection would be a good idea too.

For distance measurements, you could use dead reckoning. For example, full power on all motors for 2 seconds equals 2 feet. But the first improvement here is wheel encoders. They will give you accurate distance regardless of hill climbing or battery power. They do not detect slipage.

The next step would be an infrared homing beacon, because it is simple and cheap. This will help correct for slippage.

Now your bot can move around, bang in to things and find its way home.

For software, buld the map as you move. I was actually thinking of doing it on my pc in processing via bluetooth because it would be easier to figure out what was happening. You could start with a black screen with the word home in the center. As the bot moves, it marks its path in white and obstacles in red.
53  Forum 2005-2010 (read only) / Interfacing / Re: Upload Sketch from Processing? on: November 05, 2010, 03:03:41 pm
That's right.

Remote procedure calls is a big area in more sophisticated systems, but you don't expect them in systems like these. They can be very difficult to use.

And I'm glad you have all your teeth!
54  Forum 2005-2010 (read only) / Interfacing / Re: Upload Sketch from Processing? on: November 04, 2010, 10:30:10 pm
I hope this is what you are looking for, but I'm having trouble understanding.

You can create a processing sketch and an arduino sketch that talk to each other, but no where do they exchange code.

For example, the processing sketch could control the arduino by sending commands. The processing sketch could display icons like 'go forward' or 'stop'. When a mouse click is detected on either icon, processing sends to arduino over the serial connection a 'g' or a 's'. The arduino receives the command over the serial connection and based on a switch statement calls either the goForward() or stop() methods.

Configuration could be done the same way. Just define a bunch of commands in the arduino for setting configuration variables and have processing send them.
55  Forum 2005-2010 (read only) / Interfacing / Re: Autonomous robot's navigation on: November 04, 2010, 10:10:16 pm
Can you describe the image processing hardware? Is it all done on the bot?
56  Forum 2005-2010 (read only) / Interfacing / Re: How to control the Arduino with MATLAB in realtime on: October 08, 2010, 02:08:05 pm
Quote
A better question would be: how does one afford MATLAB????

If you are in college, it's like $130.
57  Forum 2005-2010 (read only) / Troubleshooting / Re: Loose Fitting Ardweeny on: September 20, 2010, 09:23:46 pm
Yes, it hard to locate the right stuff on Mouser. I try to stay with just a few vendors so I don't get completely killed on s/h. Like just ordering a couple of the very nice looking sockets from Jameco will end up being like $10 and reorders will be the same. I probably should try DigiKey to see how fast UPS ground gets to nyc.

The Ardweeny comes loose often. I hope the socket works. I'm also adding a low power led for my second battery. It's a no brainer as long as there is a free a/d and bread board space. The bot (just tank treads and IR now) needs to be reliable before adding navigation and wireless.

Thanks again for the advice.
58  Forum 2005-2010 (read only) / Troubleshooting / Re: Loose Fitting Ardweeny on: September 16, 2010, 12:50:35 pm
Do either of these from Mouser look ok:
http://ph.mouser.com/ProductDetail/Tyco-Electronics-AMP/1-390262-2/?qs=sGAEpiMZZMs%2fSh%2fkjph1tvt1%2fmEPT%2fXoQ0CnX1SPc98%3d
http://ph.mouser.com/ProductDetail/Tyco-Electronics-AMP/1-390261-9/?qs=sGAEpiMZZMs%2fSh%2fkjph1tvt1%2fmEPT%2fXo7eKgqaeaqYE%3d

They don't have the same look as the one from Jameco. I'm not sure what machined means.
59  Forum 2005-2010 (read only) / Troubleshooting / Re: Loose Fitting Ardweeny on: September 15, 2010, 11:09:18 pm
Thanks Dave,

I'll try the socket.

I love Italian. They can even make electronics sound sexy like Duemilanove. Ardweeny sounds like it was named by a five-year-old boy.
60  Forum 2005-2010 (read only) / Troubleshooting / Loose Fitting Ardweeny on: September 15, 2010, 06:56:07 am
Has anyone had trouble with their Ardweeny not seating well in a breadboard?

I added a thick rubber band that helps a bit. The leverage from the cable   (when connected to USB) seems to pull up one side.

This is the bread board: http://www.allelectronics.com/make-a-store/item/PB-400/SOLDERLESS-BREADBOARD-400-CONTACTS//1.html

Has anyone had similar troubles? How did you solve it?
Pages: 1 2 3 [4] 5 6 ... 9