Show Posts
Pages: 1 ... 43 44 [45] 46 47 ... 67
661  Using Arduino / Networking, Protocols, and Devices / Re: Problem reading serial data on: December 06, 2012, 08:49:20 am
Sorry, the compiler comment was intended for another thread.  Need coffee.

Best,

-br
662  Using Arduino / Networking, Protocols, and Devices / Re: Problem reading serial data on: December 06, 2012, 08:47:46 am
Voltage is voltage, yes?  Standard RS-232 is +/- 12 volts and extremely toxic to Arduino inputs, which are rated 0-5V max.  You need level shifting.  Search the forums, this is a well-worked topic.

It's possible you have damaged the inputs on your Arduino, but you might have gotten lucky.  If you see weird results once you've resolved the voltage level situation, try moving to other pins.

Good luck!

-br
663  Using Arduino / Networking, Protocols, and Devices / Re: Problem reading serial data on: December 06, 2012, 08:37:49 am
Sounds similar to this post:

http://arduino.cc/forum/index.php/topic,135973.msg1022262.html#msg1022262

-br
664  Using Arduino / Networking, Protocols, and Devices / Re: Problem reading serial data on: December 06, 2012, 08:32:24 am
Looks like it should work.  Might help to know a little more about the hardware setup.   What kind of electrical output does the GPS have (RS-232, 5V TTL serial, or 3.3V TTL serial), and how do you have it connected?

-br
665  Using Arduino / Networking, Protocols, and Devices / Re: Problem reading serial data on: December 06, 2012, 08:15:18 am
Try Serial.begin(4800) in the arduino program.  The baud rates have to match or you get garbage like that.

-br
666  Using Arduino / Storage / Re: SD writer code ultra light on: December 05, 2012, 08:47:16 am
That is great.  I will try it with Bitlash and celebrate the extra free RAM.  Thank you.

Are there any differences in the API compared with its bigger cousin that one should be aware of?

Best,

-br
667  Using Arduino / Project Guidance / Re: Sync multiple arduino-based clocks on: December 05, 2012, 08:36:30 am
One low-cost wireless approach would be to use the 433MHz  send/receive modules and the VirtualWire library to send an occasional sync signal.

Available many places, including Sparkfun: https://www.sparkfun.com/products/10534

-br
668  Community / Bar Sport / Re: Do these people get paid by the LOC? on: December 05, 2012, 08:14:24 am
Some mistakes were built to last:

http://stackoverflow.com/questions/218123/what-was-the-strangest-coding-standard-rule-that-you-were-forced-to-follow

-br
669  Using Arduino / Project Guidance / Re: Telescope control indiserver - Firmata - real time commands on: December 03, 2012, 05:46:58 pm
Sounds like you have all the pieces already; you don't need Bitlash in your setup, but you may need to modify the Firmata on the arduino to accept the pointing commands.  That's where I'd start to dig.

-br
670  Using Arduino / LEDs and Multiplexing / Re: Arduino Serial Monitor on: December 03, 2012, 04:50:05 pm
Spot on.  time.sleep(2) after you open the serial port usually does the trick.

-br
671  Using Arduino / Project Guidance / Re: Wind Visualiser Project on: December 03, 2012, 04:39:21 pm
Interesting project.

I don't know if it's your bug, but this line jumped out at me:

Code:
int x, iSpeed;

Shouldn't they be unsigned long, since speed is?

-br

Edit: never mind, I see they are the scaled output.

672  Using Arduino / Programming Questions / Re: Dynamic DNS only working locally on: December 03, 2012, 01:17:35 pm
The Arduino needs the IP address of a "gateway" to forward packets to the outside internet.  Without a gateway, the symptoms are just what you're seeing: works okay locally, can't hit it from outside.

Normally the gateway IP is the IP address of your router, which for your network it looks like might be 192.168.1.1  Also, a network mask is required.

I don't see a gateway or network mask being initialized in the code you posted.  If you look at the Ethernet Chat Server example that comes with the Arduino ethernet library you'll see an example of how it's done.

-br

673  Using Arduino / Programming Questions / Re: Struggling with switching Arduino and Random numbers on: December 03, 2012, 07:58:21 am
Mazza: A certain amount of discouragement and fruatration is normal.  There is a lot to learn, and as you say it is not always set out in the easiest way.  Don't give up.

I took the time to go through your code and produce something closer to what you want.  Let me offer some feedback about what I found while editing.

1. The construct 'if (x=HIGH)' should be 'if (x==HIGH)'.  Note carefully the difference.  The first one assigns HIGH to X.  The second one tests whether x is equal to HIGH.  If you use the first where you think you are using the second one you get an interesting debugging experience.

2. The construct 'if (x==HIGH');' should not have the semicolon after it.  Semicolon is a statement.  This construct says "if X is HIGH do nothing", and the following statement is executed without regard for the if.  Another interesting debugging experience.  Use if(x==HIGH) {stmt;stmt;stmt;} instead.

3. The code wasn't consistently indented to reflect the nesting structure.  This will trip up your eyes when you try to find bugs.  Adopt a consistent style, preferably by reading and imitating code from people you like.  Fortune favors those who keep their code neat as a pin.

4. Thinking carefully about the algorithm pays off.  Look how much simpler the loop() is below.

Code:
byte whichpin = 3; // set to 3 so turning it off is harmless

void setup() {
    Serial.begin(9600);         
    randomSeed(analogRead(0));
    pinMode(2,INPUT);
    pinMode(3, OUTPUT);
    pinMode(4, OUTPUT);
    pinMode(5, OUTPUT);
    pinMode(6, OUTPUT);
    pinMode(7, OUTPUT);
    pinMode(8, OUTPUT);
    pinMode(9, OUTPUT);
    pinMode(10, OUTPUT);
}

void loop() {
if (digitalRead(2)) {
digitalWrite(whichpin, LOW);
whichpin = random(3,10);
digitalWrite(whichpin, HIGH);
}
}


There is a lot of fun to be had here when things are working correctly, but a certain amount of frustration is part of the bargain.  Stick with it, you'll figure it out.

-br

674  Using Arduino / Installation & Troubleshooting / Re: Basic question on: December 03, 2012, 07:18:50 am
If you can load Blink, the uploading process is fine.

It's more likely you have a bug, or a software/hardware issue.

It may help to blink an LED in your bigger code, too, as a heartbeat indicator.  And it's probably time for some Serial.println() debugging.

-br
675  Using Arduino / Project Guidance / Re: Telescope control indiserver - Firmata - real time commands on: December 02, 2012, 08:43:50 pm
What a great project.

The way you've described the system, I'd look at modifying the firmata GUI program to accept inputs from your server.  Can't say how hard that would be without seeing the source, presuming it is open.

If you're not wedded to a firmata solution, I've published a web front-end toolkit for Bitlash named Bitlash Commander that allows control of an Arduino from a web interface using Bitlash script.  It's a similar architure with Bitlash substituted for firmata.

You could build your control interface as a Commander page and extend Commander to accept input from the indiserver, same as you're looking at for the firmata path.

Bitlash Commander: https://github.com/billroy/bitlash-commander
Bitlash: http://bitlash.net

-br
Pages: 1 ... 43 44 [45] 46 47 ... 67