Show Posts
Pages: 1 ... 4 5 [6] 7 8 ... 10
76  Using Arduino / Programming Questions / Re: Simple While Loop Problem on: February 03, 2011, 01:04:49 am
yes that makes more sense.  but is there a way to give the arduino input pin a valid low without explicitly tying it to ground?  this pin will be switching on and off VERY quickly (probably less than 5ms) so it would be impossible to do it by hand
77  Using Arduino / Programming Questions / Re: Simple While Loop Problem on: February 03, 2011, 12:46:19 am
Quote
If you don't want to use an external resistor you can learn how to enable the internal pull-up resistor for the input pin, and use a jumper wire from the pin to ground. Pull the wire you read a high, insert the wire and you read a low.

Im sorry but i don't really understand this part.  jumper pin 9 to ground, thats about all i got
78  Using Arduino / Programming Questions / Re: Simple While Loop Problem on: February 03, 2011, 12:32:06 am
I have changed the time incrementation to:
Code:
time = time + .00010

but now I am just getting some really strange and inconsistent results...is that because i dont have it with 10k pullup resistor?
79  Using Arduino / Programming Questions / Re: Simple While Loop Problem on: February 03, 2011, 12:18:51 am
Yeah i noticed that i wasnt testing tripped inside the loop so i fixed that.  now the problem i am having is that time is not actually updated and after the while loop it continues to be 0 as defined.  Here is my new code:
Code:
int speed1 = 9;
int tripped;
float time = 0;
float Speed;

void setup()
{
  pinMode(speed1, INPUT);
  Serial.begin(9600);
  Serial.println("Ready to Test Speed");
}

void loop()
{
  tripped = digitalRead(speed1);
  if (tripped ==1)
  {
  while (tripped == 1)
  {
    delayMicroseconds(10);
    time + .000010;
    tripped = digitalRead(speed1);
  }
  Serial.println(time);
  time = 1000000*time;
  Serial.println(time);
  Speed = 5.0/time;
  Serial.println(Speed);
  }
}

i wish to increase the floating integer time by 10 micro seconds.  so that for example, if pin 9 is high for 1 second, i would have a sampling rate of 10microseconds and so i could get a pretty accurate speed value.

as for the hardware, i have pin 9 directly into 5v on the arduino uno
80  Using Arduino / Programming Questions / Re: Simple While Loop Problem on: February 02, 2011, 11:22:02 pm
anyone?
81  Using Arduino / Programming Questions / Simple While Loop Problem on: February 02, 2011, 10:40:56 pm
Hi, I've never been any good with while loops but this one is not working and I can't figure out why.  Basically, whenever pin 9 is read as HIGH the while loop begins, and begins incrementing time by 10 microseconds.  Then when pin 9 is no longer HIGH (removed from 5v), the while loop ends and the a constant is then divided by the time, to give a rather accurate speed measurement.  Here is my code, hopefully someone can help.

Thanks everyone.
Code:
int speed1 = 9;
int tripped;
float time = 0;
float Speed;

void setup()
{
  pinMode(speed1, INPUT);
  Serial.begin(9600);
  Serial.println("Ready to Test Speed");
}

void loop()
{
  tripped = digitalRead(speed1);
  Serial.println(tripped);
  while (tripped !=0)
  {
    delayMicroseconds(10);
    time + .000010;
    Serial.println("Reading...");
  }
  Serial.println(time);
  time = 1000000*time;
  Serial.println(time);
  Speed = 5.0/time;
  Serial.println(Speed);
}
82  Using Arduino / Project Guidance / Re: Data from Internet to Arduino on: January 28, 2011, 01:45:59 pm
cool, i will try the suggested methods out when i get home...also, instead of reading the received data into a string, what about reading it into a buffer so i can parse each individual byte and do switch case statements accordingly?
83  Using Arduino / Project Guidance / Re: Data from Internet to Arduino on: January 28, 2011, 05:50:06 am
yes but there isn't a whole lot of good info for getting data submitted on a form or a button being clicked...has anything been done with SSH or any other similar protocols?
84  Using Arduino / Project Guidance / Data from Internet to Arduino on: January 27, 2011, 09:38:48 pm
Hi, I am trying to think of some ways to get data from the internet (say a php page) to the arduino for parsing.  The only current way I can think of is to setup a telnet server on the arduino with a public ip and then use php to send telnet commands to that arduino.  but surely there must be some better way to send some data from the internet to the arduino.  data from arduino to php is quite easy but it doesn't seem to be so easy going the other way.  does anyone have any great ideas or experience towards this problem?
85  Using Arduino / Project Guidance / Re: Need guidance... :) (with RS232 and Arduino protocols) on: January 27, 2011, 07:33:55 pm
For the drawings:  EAGLE Cadsoft, great easy circuit software and FREE

For RS232 converting, this may work:  http://www.sparkfun.com/products/10270

http://www.pololu.com/catalog/product/1112  This is a relatively high power DC motor serial controller (15A)

http://www.pololu.com/catalog/product/1110  Here is it's lower power sibling  (1A)

You can dim the LEDs directly from the arduino, although depending on the amount you may need some external circuitry (you've only got 40mA from each I/O Pin)

There are alot of nice serial controlled servo controllers out there.
86  Using Arduino / Project Guidance / Re: Video and control over rf on: January 27, 2011, 07:24:25 pm
thats kinda what i was suggesting, i know i've seen a lot of projects involving the arduino/ethernet shield/wirelessrouter...in fact right now im working on a circuit board that combines the ethernet shield and arduino main board all onto one board, so then all you need is the router  smiley-grin
87  Using Arduino / Project Guidance / Re: Email Timing Issue on: January 27, 2011, 07:21:59 pm
not sure if this is connected, but i am kinda having the same problem.  i have a telnet server set up on the arduino and when a specific command is sent to it, it sends a get command to the php site which the php site then uses to compare against a mysql page which then sends out an email to a specific address...anyhow the problem i'm having is that i run the command, email goes out, run it again and email goes out, third time and on, connection to the php server fails and nothing goes out.  maybe this is your problem as well, maybe the connection is failing and then later going out again once the connection is re-established.  just a thought
88  Using Arduino / Project Guidance / Re: Need guidance... :) on: January 27, 2011, 12:35:10 pm
yeah im not sure what i was thinking at the time.  i just mentioned ethernet as i have a nice little telnet server running on the arduino right now that can communicate over the internet rather well so i was suggesting along those lines.  but i hadn't even thought of just using a pair of cat5 for the video (how simple).  i knew ethernet was a complex protocol but i didn't think it was that bad.  anyhow this isn't my project so i don't want to sideline it anymore, the subject matter of the project is interesting though
89  Using Arduino / Project Guidance / Re: Need guidance... :) on: January 26, 2011, 11:47:26 pm
what kind of overhead do you mean?  What other ways would there be to get the video from the submarine to the computer?  I thought serial was too slow for that
90  Using Arduino / Project Guidance / Re: Need guidance... :) on: January 26, 2011, 11:41:42 pm
if it were my project i would try and do most of the commands/video via ethernet and ethernet protocols.  especially since there already exists a very nice ethernet shield made by arduino.  but maybe thats because i know more about ethernet protocols than serial....i could be way off base though  smiley-grin
Pages: 1 ... 4 5 [6] 7 8 ... 10