Show Posts
Pages: 1 [2] 3 4 ... 252
16  Using Arduino / Programming Questions / Re: Maze Solving Problem on: September 26, 2014, 06:57:33 am
I wonder if you have misunderstood your instructions or if they are confusingly stated. Unless you've previously got so good at Arduino coding using the standard functions (digitalWrite et al) that your teacher wants to give you a better appreciation of what's under the hood, this seems like a very odd restriction. It doesn't sound as if you & your classmates are at this point.

I can see perhaps that if you've been using a Robot library perhaps that now you're being asked to work without it.

In any event, if I had to do this assignment, I'd write a bunch of functions called MyDigitalWrite etc to replace the ones that are off limits. Given that I (and you) have access to the source code, it's quite likely that my replacement functions would look very similar, though not identical, to the core functions they mimic  smiley-wink
17  Using Arduino / Programming Questions / Re: New to arduino programming, need help please on: September 24, 2014, 04:57:03 pm
This:
Code:
  delay(60 * 60 * 1000);
would be better as:
Code:
  delay(60UL * 60UL * 1000UL);
To avoid overflow issues, although actually one of the numbers having a UL suffix would do.

Then swap out one of the 60s for 1 and test it! Unless you want to watch it for an hour of course.
18  Using Arduino / Programming Questions / Re: Trouble with PID library and fan control on: September 23, 2014, 02:33:52 pm
The reason for the outputs in the 0-255 range is that that is the range that analogWrite gives you to vary the power on the PMW'd device between zero and max.

There is no need to transform the temperature reading into the same range; you can continue to work in Celsius. The PID simply looks at the difference between set point and current temp to help calculate how much power it needs to give to the fan. The units don't matter.

You may get better insight by serial.printing the set point, input  and output values each time the PID computes.

Also, are you sure your fan is having a cooling effect? If you're just blowing ambient temperature air around, it may feel cooler to you due to evaporative effects on your skin, but the DS18B20 won't see any difference.
19  Using Arduino / Project Guidance / Re: Long range connectivity Arduino-------- on: September 22, 2014, 10:43:57 am
An Xbee mesh seems ideal - you can add in additional routers to bridge your way from your base station to the remotes. However, they really don't fit your criteria of cheap, especially for a minimum of 40 nodes. Will you need an arduino at each node too? How will you power them all?
20  Using Arduino / Programming Questions / Re: Arduino - general tutorials/lessons on coding? (C/C++?) on: September 22, 2014, 06:51:34 am
The bigger, the better, usually.
Agreed. OP - here are two rare exceptions worth looking at:
The C programming language.
C++: the core language.
21  Using Arduino / Programming Questions / Re: SOS using AnalogWrite on: September 21, 2014, 09:38:37 am
I though that if I hovered near one curly bracket, it would show its mate.  It doesn't seem to do that

Not hover; the cursor needs to be after the bracket you're seeking a mate for.
22  Using Arduino / Project Guidance / Re: CapSense does not name a type error on: September 21, 2014, 09:28:57 am
Hmm. Yes I downloaded the 4 zip file, and just saved to my Arduino examples file.

If you meant examples, there's your issue - it should be in your personal libraries directory
23  Using Arduino / General Electronics / Re: Im programmer who interested in Arduino help on: September 21, 2014, 07:41:43 am
You don't have to learn about electronics - there are many many projects you can do just following online tutorials and treating the components like lego.

When it comes time to debug your project though,  that's a different story.
24  Using Arduino / Programming Questions / Re: Turning on multiple relays with space bar on: September 21, 2014, 07:13:11 am
A simple solution would be to use 'a', 'b', 'c' etc for the relays numbered higher than 9.
25  Using Arduino / Project Guidance / Re: How to tackle curious project on: September 21, 2014, 06:49:25 am
It's hard to say without more detail - how far is many meters? Would it be plausible to run wire between the arduinos?

That said, is there ethernet in the building? If so I'd use an Arduino per control panel and an ethernet shield to do the comms. If not, wifi or xBee for preference - RF to save money.
26  Using Arduino / Programming Questions / Re: Jumping back to "void loop();"? on: September 21, 2014, 06:38:34 am
This is a problem:
Code:
// setSwitches is a function to set the switches

  void setSwitchesLeds();  //setting the RF switch positions; depends on value of switchSettingVal

Firstly, this section is inside the loop function - you're not allowed to define one function inside another in C.

It compiles because of the semicolon on the end - the compiler interprets it as a function prototype, not the start of a function definition.

To fix this and get it to compile at least, delete the semicolon, put a closing brace above that line and an opening brace below. Then look at where you tried to call setSwitches and delete the word void.
27  Using Arduino / Programming Questions / Re: Comparing live GPS data from phone to database of coordinates on: September 21, 2014, 06:17:31 am
Most arduinos have very little RAM and the space for your code (FLASH, progmem) is limited too. That kills your dynamic vector idea, but MarkT solved that for you in reply #1. However, as Jremington remarks, use of float doesn't give you the resolution you need.

One solution is to transform your data and work in different units - feet or meters perhaps depending on the size of the beach. Choose some arbitrary datum point and create your own "EsalaDE's" grid, doing the transform before you load it to the arduino's progmem. Then your coordinate data can simply be int. The arduino will need to be able to perform the same transformation on the incoming GPS data from the phone of course. 

It's not necessary, but I'd also be tempted to change the radioactivity data to be byte - still overkill - you only need five different values to tell you which LED to turn on.
28  Using Arduino / Programming Questions / Re: Comparing live GPS data from phone to database of coordinates on: September 20, 2014, 09:05:58 am
Since your phone has far more processing power and storage than the arduino, consider doing all this work on the phone. Just send a message over bluetooth to the arduino to tell it what to do with the LEDs.
29  Using Arduino / Project Guidance / Re: AlarmLibrary or selfbaked? on: September 20, 2014, 08:18:01 am
The time taken to calculate whether a scheduled event is due should be negligible; use a library or roll your own since that's your preference. The non-responsiveness in your system is apparently caused by the length of time it takes to "do my stuff", particularly, by the sound of it refreshing the screen.

You might consider splitting "do my stuff" up into subtasks and only do one of them on each iteration of loop. i.e. the millis checks tell you what tasks it's time to do and on each subsequent iteration of loop, pick just one of them and do it so you can respond more quickly to button presses.

It also sounds like you should consider optimizing your screen refresh routine - can you just redraw what's changed?
30  Using Arduino / Programming Questions / Re: Temperature/humidity sensor & AC Relay interaction question on: September 19, 2014, 07:50:40 am
There are plenty of threads in the forums that discuss combining sketches. Grumpy_Mike has a tutorial on the subject too: http://www.thebox.myzen.co.uk/Tutorial/Merging_Code.html

For your requirement, it should be pretty trivial to do but post your code if you get stuck.
Pages: 1 [2] 3 4 ... 252