Show Posts
Pages: 1 ... 97 98 [99] 100 101 ... 230
1471  Using Arduino / Programming Questions / Re: Program freezes after a while on: February 03, 2013, 04:41:32 pm
Find a way to get some debugging output though - can you use other pins to softserial or SPI to another arduino to get something on the serial monitor or does your PCB design preclude this?
1472  Using Arduino / Programming Questions / Re: Initiallizing local variables on: February 03, 2013, 08:07:15 am
The static modifier does what you want:
void loop()
 static int Count=0;
somthing happen somwhere here
and then Count++;
1473  Using Arduino / Programming Questions / Re: Program freezes after a while on: February 03, 2013, 07:53:00 am
Do you have any way to get debug info out of the system? If not, I'd be inclined to use softwareserial to talk to the other arduino and leave the hardware serial port free for debugging. I'd be interested in the value of switch_count. Depending on the setup in EEPROM, it looks like there is potential for it to be greater than max_switches.
1474  Using Arduino / Networking, Protocols, and Devices / Re: How to read Xbee S1 data on a serial monitor on: February 03, 2013, 07:38:50 am
The likely issue is that your xBee shield is using pins 0 and 1, so you can't use the serial connection to the PC at the same time.

For debugging purposes, you could detach the shield and wire it up manually using breakout wire and use softwareserial on another pair of pins to communicate with the shield. IIRC, all you need to connect is tx, rx, power and ground.
1475  Using Arduino / Project Guidance / Re: // reeftank controller guidance plz on: February 03, 2013, 06:51:40 am
Have you considered a bottom up approach? Rather than worrying about the big picture and struggling because of the complexity, take a subset of the system and get that working. Either as a standalone sketch or better as a function or two that are called from loop. One place to start might be be reading the RTC - trivial, because you can likely lift all the code from existing examples. Then write something that prints to the serial port what you should be doing at that time of day.

Then add the temp sensor that checks on the lights. Once that's working, put in the stuff to control the fans that cool them. etc. etc.

This way, you'll acquire a set of functions you can use as building blocks for your system and best of all, you'll see some immediate progress. Another advantage is that people here can give you some concrete advice if you're having issues with these sub projects because you'll have some code and circuitry that they can comment on.
1476  Topics / Home Automation and Networked Objects / Re: Program Automated? on: February 02, 2013, 07:56:35 am
I'd start with the program on the PC that figures out which program you're running - it's not especially difficult, but non-trivial nonetheless. Once you have that, it should be a fairly simple matter to add code to send instructions to the arduino over the serial port or UDP, whichever way you decide to connect it.
1477  Using Arduino / Networking, Protocols, and Devices / Re: Arduino Network causing severe battery drain on WiFi connected devices. on: February 01, 2013, 04:17:36 pm
Interesting. I see the same thing happening with my arduino ethernet: every time it wants to talk to its target web server, there is an ARP request. Mind you, there's a bunch more ARP requests going on that don't make sense either - some of them generated by the router, and my Mac and XP box seemingly can't remember each others MAC address. I suspect that the same thing is going on with my wifi shield too but I can't see that traffic with wireshark.
1478  Using Arduino / Project Guidance / Re: Help: arduino php mysql (electronic toll booth) on: February 01, 2013, 04:07:10 pm
Per your request, the whole thing is attached. The code is for an arduino ethernet with an Xbee. It receives temperature data from another arduino and then sends it to a web server. Obviously, you can drop the xBee stuff and put in your own temp reading. The original version just used wifi and the sensing arduino sent the temps direct but it didn't work in the target location because the wifi signal was too weak.

1479  Using Arduino / Project Guidance / Re: Cant control servo angle via serial, why?? on: February 01, 2013, 03:14:12 pm
I've never used processing, but since you're expecting to build a string on the arduino, how about using "500" instead of 500 in the call to myPort.write.
1480  Using Arduino / Project Guidance / Re: Thermostat / Home Security / Automation project on: February 01, 2013, 10:54:43 am
Go with option two, for liability reasons if nothing else.
1481  Using Arduino / General Electronics / Re: how do i control my 2 servo motors? on: February 01, 2013, 10:27:28 am
You have got your loop arranged so that your servos only move when a button is held down. From your description, what you really want is for a button press to toggle between moving and stopped. You need to detect a transition from not pressed to pressed and only then change the state of the motors. Search the programming forum for words like transition, debounce, prevbuttonstate, currbuttonstate; it should pull up some useful examples of using buttons in this way.
1482  Using Arduino / Project Guidance / Re: Sending data from arduino+ethernet/wifi shield to a sql server (MS) on the web on: February 01, 2013, 10:04:31 am
No, your PHP server can use whatever database suits you. The only reason I used MySQL was because I already had a web server (LAMP) set up with it ready to go. You can use the same GET method to send the data to the PHP driven site, what it does with that data is up to you.
1483  Topics / Home Automation and Networked Objects / Re: home automation with arduino mega 2560 on: February 01, 2013, 09:11:51 am
Very hard to say without a look at the code or schematic. Just a guess, but have you wired the arduino outputs directly to the relay? If so, it's quite possible that the arduino can't source enough current to switch them. Take a look in the playground at the example for wiring up a solenoid - it shows how to use a transistor & flyback diode to wire such things up.
1484  Topics / Home Automation and Networked Objects / Re: House Automation Question on: February 01, 2013, 09:06:46 am
Arduino has been used by many people for this purpose - check this section for posts by draythomp to see some examples. The arduino is single threaded so it won't actually do things truly simultaneously, but it is fast enough that for domotics purposes, you won't notice. The model you choose will of course depend on how many things  you want to sense/control.
1485  Using Arduino / Project Guidance / Re: Sending data from arduino+ethernet/wifi shield to a sql server (MS) on the web on: February 01, 2013, 08:53:16 am
How much help do you want? By which I mean is this a learning experience or are you looking to get it working quickly by adapting existing code? If it's the latter, you might find this interesting:,69165.0.html
Pages: 1 ... 97 98 [99] 100 101 ... 230