Show Posts
Pages: [1] 2 3 ... 48
1  Forum 2005-2010 (read only) / Troubleshooting / Re: Reading a multiple digit number with Serial.read() on: March 23, 2010, 03:22:24 am
This code uses a handshake method. Start and stop characters are used, so the serial will start reading when it gets chr(10), and it stop's reading when it gets chr(13). Whatever is in between you add together using "code[bytesread] = val;"

You should be able to adapt this to suit your needs, otherwise there's plenty of other material around the forums for doing the same job.

Code:
void checkSerial() {
  if(Serial.available() > 0) {                  // if data available
    if((val = Serial.read()) == 10) {   // check for header start
      bytesread = 0;
      while(bytesread<1) {              // read 1 digit code
        if( Serial.available() > 0) {
          val = Serial.read();
          if(val == 13) { // check for header end
            break;                            // stop reading
          }
          code[bytesread] = val;         // add the digit
          bytesread++;                   // ready to read next digit
        }
      }
      if(bytesread == 1) {                 // if 1 digit read is complete
        incomingByte = int(code[0]);
        doSomething();
      }
      bytesread = 0;
      delay(50);                             // wait for a second
    }
  }


}
2  Forum 2005-2010 (read only) / Troubleshooting / Re: Save strings in EEPROM on: June 26, 2009, 10:26:45 pm
You need a function like this, whereby:-

newWriteLocation is the start position in eeprom
byteCount is the length of yourString

EEPROM.write(newWriteLocation+byteCount, int(yourString[byteCount]));

Once you start storing data in eeprom, you might need additional routines to:-

search records
delete records
add new records
determine number of free blocks available

And each of those routines need supporting routines, like you might want to use 2 large arrays, both the same size as eeprom, that you manipulate before writing the entire array back to eeprom, especially if your trying to delete a string and reorder the eeprom to make more efficient use of the available space after the strings been deleted.

It's a real can of worms unless you can find code in the playground that already does what your wanting.
3  Forum 2005-2010 (read only) / Troubleshooting / Re: Serial Input in Windows 7 on: June 09, 2009, 12:04:22 am
@madworm

If MS programmed their OS as well as they've programmed their consumers then the world wouldn't need OSX.
4  Forum 2005-2010 (read only) / Troubleshooting / Re: 595 Shift Registers on: May 20, 2009, 08:16:26 pm
http://www.arduino.cc/en/Tutorial/ShiftOut
5  Forum 2005-2010 (read only) / Troubleshooting / Re: s/w lock-up on Vista? on: April 11, 2008, 12:25:10 pm
Weird, I experienced the same thing on OSX 10.3.9, twice - I thought it might have been my machine acting flaky, or that I hadn't pressed reset at the right time or long enough.

Both times, I had to power re-boot to get the USB port working again.
6  Forum 2005-2010 (read only) / Troubleshooting / Re: SoftwareSerial timeout on: January 19, 2008, 07:39:09 pm
Quote
hmmmm....  

Does my question not make sense?  Or is nobody else running into this issue?

Thanks all for any input/insight/work-arounds etc.

 :-/

Your question makes perfect sense, software serial doesn't have serial.available, so when you break a loop to check a device, there is no way to get back to that loop unless the device does something.

There should be a "BIG sticky" about this on the SS page, because unless you know about the missing serial.available function, and what it implies, an enormous amount of time can be wasted implementing it.

The solution we're throwing around at the moment, is porting to ATMEGA128 and the wiring board, or, using I2C, which does have a .available function.



7  Forum 2005-2010 (read only) / Troubleshooting / Re: ROV motor on: September 10, 2007, 04:32:35 am
I cee, yip that would work, use one for max and another for half - I still like the pulse idea though, I'll be trying that one with trusty tooth brush smiley
8  Forum 2005-2010 (read only) / Troubleshooting / Re: ROV motor on: September 09, 2007, 03:33:50 pm
Quote
heh heh, yeah. I like the relay way.  arduino has got pletny of analog outputs. im going to hold off on gps and xbee. expencive stuff. but yes. i should probably start with something smaller scale like this http://www.rgu.ac.uk/eng/robotics/page.cfm?pge=8192
PS. does that ajustable resistor thing from afew post back egsist?

Perfect, but lost me re: resistor?


9  Forum 2005-2010 (read only) / Troubleshooting / Re: ROV motor on: September 08, 2007, 07:30:37 pm
yip, lots of theory to test  ;D

If you have another plan for reversing polarity, then for sure go with that.

I'll take a crack at building something autonomous, with tooth brush motors, with relays, with gps, with XBee. Worst case scenario, it doesn't work, but I like a challenge when I've got the time smiley
10  Forum 2005-2010 (read only) / Troubleshooting / Re: ROV motor on: September 08, 2007, 06:28:11 pm
For sure. I'd love to see a more efficient way of doing it too. A common problem is that sometimes devices requires a larger voltage than the board delivers. Plus you don't want the options narrowed because of those limitations. Since relays are cheap as are the 595's, until there's a better option, that would be my immediate choice.

You could pulse the motor to manage speed, which is actually quite ingenious when you think about it. I don't think pulsing would be inefficient either.

An object of neutral buoyancy also wouldn't need to conform to any particular shape. You could use a ping pong ball, for example,  attached to shaft attached to two rotary encoders to determine the objects tilt for staying flat in the water, and using thrusters for making corrections. The ROV could be the shaped like a ball, hypothetically.    

Once I'm over my current back log of work, and other projects I'm working on, I'd definitely like to put all that to the test.
11  Forum 2005-2010 (read only) / Troubleshooting / Re: ROV motor on: September 08, 2007, 03:48:34 pm
Quote
Good source for motors: rechargeable power drills. Small ones can be had for 5-10 euro. They even come with NiCd cells and a charger. I bought some and they have a 3:1 gearbax, wich seems ideal for most boat propellors. They're not waterproof, evidently.

I am building a land prototype first, wich will be wireless. Underwater, you can forget about wireless comms, I think. Hance, GPS will probably not function, unless you are really close to the surface.

Sure, underwater modems exist, but they only offer a few hundred bits/sec...

I really hope someone here will prove me wrong about underwater comms, tho  :-)

I read this at Faludi's blog

Quote
Here's a quick primer on how to program an Arduino over a wireless connection.

Now, we can put an Arduino on the ceiling, underwater, up a tree, stuffed in a turkey or what have you and still be able to change and improve its behavior. In fact, by adding an XPort or WiPort to the XBee, we can extend the connection over the Internet, and program anything from pretty much anywhere.

It's worth checking out first though I can't be sure he was joking or serious.


12  Forum 2005-2010 (read only) / Troubleshooting / Re: ROV motor on: September 08, 2007, 03:43:53 pm
I think if variable speed is an issue, then you'll be needing another solution, and not one that springs to my mind.

I had envisaged the motors would be turned on to initiate thrust, and when that's been achieved, they'd be turned off. Using two relays, forward and reverse wouldn't be a problem, and using daisy chains of 74HC595 shift registers, 8 relays each, you can control any number of relays, which incidentally, have a UL/C-UL rating of 10A 28VDC / 12A 125VAC.

You can hack this code ( http://www.arduino.cc/en/Tutorial/ShiftOut ) for controlling the relays, substituting the LED's and bypassing the 220ohm resistors.

For a sub, a ballast system would be needed, and if I were lucky enough to be working on such a project, I'd also need to be working on a solution.

Attached to large enough propeller, I think the tooth brush motors would be perfect, they aren't expensive either so you could use a few for thrusting in different directions. Electric screwdrivers would also do the job.

Your battery options are wide open if your using relays, XBee "apparently" works underwater (properly sealed). Maybe Arduino BT could function underwater, if I had one, I'd throw it in a bath tub to test it for you unfortunately I don't, so perhaps someone else might volunteer.

Here's an interesting link with more info on XBee:-

http://blog.faludi.com/category/networking/

The Arduino, I recently discovered, fits nicely inside the old audio cassette boxes, with room for batteries. You'd need to check if there's room for an XBee, fortunately, that also won't cost much to determine.

For water-proofing, silicone sealant doesn't cost much. Though, a few months back I starting working with thermo-plastics (Easycast) which allow you to sculpt a clay model, make silicone (Ultrasil) molds, and fabricate any shape you can imagine in plastic.  So, building a custom water-proof enclosure would be a matter of adapting something that's already water-proof, or, you could build one specific to your requirements.  

Cameras and control, unfortunately I haven't reached that chapter yet either  ;D
13  Forum 2005-2010 (read only) / Troubleshooting / Re: ROV motor on: September 08, 2007, 01:22:33 am
hey weird timing. I was looking at a larger version of that design a few wees back, it looked like it had got itself stuck in a lake amongst some lake-gunk. One thing I'd like to build is an autonomous ROV using gps to chart its way around the shorelines. I think I'd prefer a more efficient design like a tube or classic sub shape, that way less power would be needed for propulsion as these ROV designs don't look very hydrodynamic. You could use relays for switching, I just bought 50 x 5v for 12 bucks off ebay so they're not expensive.  Any of the LED examples will power a 5v relay, you just need to hop the 220ohm resistor(s). I've seen a design using a battery powered toothbrush, I pulled one apart the other day and the motors pack quite a punch, and they're already water proof.  The larger motors they've got attached to that thing I wouldn't know what they're called, Curvetech Thrusters? They look expensive. Anyway, all very doo'able with Arduino, and then some  smiley
14  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Arduino SoftwareSerial and MicroVGA-TEXT on: May 13, 2009, 04:25:51 am
They already did, it's called the ArduinoBoardMega which has 4 hardware UARTs.

http://arduino.cc/en/Main/ArduinoBoardMega

15  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: software serial2 on: February 11, 2008, 04:01:26 pm
Quote
this is an unreleased project, i posted it "if someone wants to play with it...", it was designed so i could hack and debug my xport shield.
its not a direct replacement for the default softwareserial so if you need multiple serial ports, different baudrates or atmega8/lilypad support then this isnt for you. in fact, it isnt even fully debugged so for all i know it may not work in certain situations.

Don't worry about the Lilypad they join at the hip quite nicely via I2C and are inexpensive enough to stack two together to provide the solution I was looking for.  

You did an excellent job it's a good start. And there's a great deal of enthusiasm for this as a solution to the nagging problem of only having one hardware serial, so moving it forward is a big accomplishment.


  
Pages: [1] 2 3 ... 48