Show Posts
Pages: 1 ... 243 244 [245] 246 247 ... 840
3661  Using Arduino / Project Guidance / Re: Overpriced Ink with an RFID... on: November 05, 2013, 09:54:39 pm
Have you confirmed that the RFID tag is actually being read by the printer and is not just something to do with stock keeping or anti-theft? Presumably you could confirm that very quickly just by removing the tag and confirm that the reel is then not recognised.

Then have you confirmed that the tag is being altered by the printer? You could do that by reading the tag on a 'new' reel and then reading the tag on a 'used' reel and seeing whether the tag is being altered. It may be that the tag is just telling the printer what type/quantity of paper is installed, or something.
3662  Using Arduino / Project Guidance / Re: rc car, arduino, and tb6612fng.. having trouble. on: November 05, 2013, 09:48:38 pm
Code:
if (distance >= maximumRange || distance <= minimumRange){
  move(1, 128, 0); //motor 1, half speed, reverse
  move(2, 255, 1); //motor 2, full speed, right

  delay(3000); //go for 3 seconds
  stop(); //stop
  delay(250); //hold for 250ms until move again
 }

Does the expression in that if statement accurately reflect when you want the reversing to occur, i.e. when the distance is outside the range minimumRange .. maximumRange ?

If so, is the code inside that 'if' statement being executed when that situation occurs?
3663  Using Arduino / Programming Questions / Re: creating an averaging function correctly on: November 05, 2013, 08:55:46 pm
the int type

It is always necessary to choose the appropriate data type, and 'integer' doesn't necessarily mean 'int'.
3664  Using Arduino / Programming Questions / Re: Problem with SoftWareSerial on: November 05, 2013, 07:14:51 pm
You're writing binary data including nulls - I think you want to use CamSerial.write(), not CamSerial.print().

The serial port speed may also be part of your problems. Although the documentation suggests that it supports speeds up to 115200 bps, in practice the higher the speed the more sensitive comms are to timing glitches, and you might find it won't actually work reliably at speeds that high in your application.

The readBytes(char *, int) you're using to read back the response isn't documented and isn't implemented in the copy of SoftwareSerial in my 1.0.4 installation. What does it do? In particular, what does it do if the number of bytes available to be read is less than the second argument?
3665  Using Arduino / Programming Questions / Re: creating an averaging function correctly on: November 05, 2013, 07:05:27 pm
I would say that a more obvious implementation using integer variables would be:

Code:
average = ((9 * average) + (1 * newValue)) / 10;
3666  Using Arduino / Programming Questions / Re: Order of functions and function prototypes? on: November 05, 2013, 06:59:49 pm
The compiler doesn't seem to care whether the included sketch is called .ino, .cpp or .h

The compiler cares a great deal, which is why you're having the problems you're having.

I'm lazy. If it works (and it seems to) it will do. I never liked the fragmentation of C projects into so many files that make it almost impossible to figure out easily what anything is.

What I described is a standard conventional 'C'/C++ structure, which is how the language was designed to be used and works on projects of all sizes. The approach you described is a nasty hack which can be made to work but is not a good approach.

How should I include a file that is not in the current directory?

If you're building it using the Arduino IDE, put it in a library. Your other option is to not use the Arduino IDE.
3667  Using Arduino / Programming Questions / Re: help with PWM soft motor pull timing on: November 05, 2013, 06:55:42 pm
Well that all seems perfectly feasible. If you use one Arduino per bell your basic sketch will be simpler but you will need a scheme to get them all started in synch. Do you have a scheme for that? (For example, power them all from a common wall socket so you can switch them on together.)
3668  Using Arduino / Programming Questions / Re: Reassigning pointers on: November 05, 2013, 06:52:42 pm
Hi guys, I have a very enigmatic question. I have function which acts on different "settings" variables which are stored in a struct. The struct stores settings for 3 seperate sections in EEPROM. To conserve working memory, I assign the variables in the struct to pointers and then operate on those pointers. Then I want to reassign the pointers to the next set of variables and operate on those.

I haven't looked at your code, but based on your description what you need is a pointer to the struct and then normal pointer dereferencing to access the individual fields within the struct being pointed to.
3669  Using Arduino / Project Guidance / Re: Raspberry Pi or Arduino for Drone? on: November 05, 2013, 06:48:04 pm
Yes, but not all can be altered with the Arduino IDE.

They would all be designed to work in some development environment, and converting any of them to work in an Arduino environment would be simple enough. Although, once you have tried any other environment you will realise that there's no particular reason to use the Arduino IDE - it's not especially good, it's just a convenient way to get started.
3670  Using Arduino / Project Guidance / Re: Help with a shield on: November 05, 2013, 06:44:32 pm
You say you have found a sketch that reads a string in from the serial port and sends it in an SMS. I assume you have tried it and confirmed it works. So just replace the serial port reading stuff with sending a single hard-coded string, and you're home and dry. You need to take stuff out, not put it in.
3671  Using Arduino / Project Guidance / Re: I NEED HELP! arduino uno R3 with motor shield 1.2 on: November 05, 2013, 06:40:11 pm
I suggest you don't use pins 0 and 1 for the sensor inputs. Use any other available digital pins. Then use the Serial port to print out the values you're reading from the sensors and see whether they're working correctly.
3672  Using Arduino / Project Guidance / Re: Time synchronization between arduinos ? on: November 05, 2013, 06:37:21 pm
I love Unix timestamps.

That's a common representation of a wallclock time, and there are plenty of other similar formats that have the same characteristics. However you represent it, you still have to deal with the fact that wallclock time is not the same as real time and can speed up, slow down, jump backwards and forwards.
3673  Using Arduino / Project Guidance / Re: Choice of steppermotor for automated blind on: November 05, 2013, 06:34:02 pm
If you need 3 Kg-cm and the servo applies 11Kg-cm then the servo ought to be sufficient. If it isn't sufficient then perhaps it isn't actually producing as much torque as it's claiming. The most likely reason for that would be that it doesn't have an adequate power source. You could measure how much torque it's actually producing in the same way you measured the weight needed to operate the blinds.
3674  Using Arduino / Project Guidance / Re: Arduino Testbed for testing watches. on: November 05, 2013, 06:30:42 pm
Moving a mechanism a controlled distance/angle at defined intervals, and measuring the mechanical resistance to that movement, would be within the capabilities of an Arduino with the appropriate sensors and actuators. You probably wouldn't want to rely on the Arduino to timestamp or log the data, but it would be feasible to connect an arbitrarily big number of these devices to a PC via USB hubs and have the PC do the logging. If this is for long term use you would probably want to write an application on the PC to monitor the set of Arduinos plugged in and start/stop logging for each one as they were connected/disconnected.

If I were you I'd log the data to a local relational database - that enables a wide variety of reporting/display methods and keeps that aspect decoupled from the basic data acquisition mechanism.
3675  Using Arduino / Project Guidance / Re: How to make a heating soure (with the arduino board) on: November 05, 2013, 06:24:36 pm
If you want the heating source to be carried by the balloon, I think you're wasting your time. However, if you want to use a Montpellier style balloon that is held down until it is hot enough and then released, that would be feasible. A balloon suffers from economies of scale though due to the squared/cubed relationship between surface area and volume; the smaller it is, the harder it is to make it fly. Something no bigger than your head will be *really* difficult and would need your balloon to consist of a soap bubble or similar with no extra structure. So you need to start with the balloon itself, figure out what volume it will be and how much it will weigh, then calculate from that the average air temperature needed inside the balloon for it to float. Once you know what air temperature you're aiming for you need to know what power sources you have available (will it be indoors with access to mains power, or battery powered?) and finally you can design your heating mechanism.
Pages: 1 ... 243 244 [245] 246 247 ... 840