Show Posts
Pages: 1 ... 246 247 [248] 249 250 ... 837
3706  Using Arduino / Programming Questions / Re: How to perform a ethernet request locally on: November 02, 2013, 11:18:10 am
My problem is now that I don't get the result on the serial monitor.

The serial output suggests you are able to connect and send the request.

Before you try to do anything clever with the response, just print out what you are getting back to see whether it is what you expect.
3707  Using Arduino / Project Guidance / Re: Hey, need some help on where to start programming! (Balancing Bot) on: November 02, 2013, 11:13:11 am
suspect you do not need #include <Wire.h> if you #include <I2Cdev.h> as the latter probably calls the former.

Because of the daft mucking-about that the Arduino IDE does with your code before building it, you need to explicitly #include in the .ino sketch file the header for every library that the sketch uses - even if it is not necessary in order to compile the .ino file. (The IDE uses the list of files #included in the .ino file to identify the libraries being used and hence what library source files to include in the build.)
3708  Using Arduino / Project Guidance / Re: Controlling Stepper Motor CW and CCW thru inputting the degrees using 4x4 Keypad on: November 02, 2013, 11:08:08 am
i need to make the stepper move in a specified position.
for example i pressed the numbers '2' and '8'( 28 degrees) and press the letter 'A' means enter/clockwise
the stepper will rotate at 28 degrees position..

I can guess that English is not your first language and it may not be easy to explain clearly what you want. If you mean that you enter '28#' and the stepper moves clockwise to the '28 degrees' position, and then you enter '20#' and the stepper moves counter-clockwise to the '20 degrees' position then your motor code is not correct; you would need to keep a record of the motor's current position, compare that with the desired new position read from the keypad, and that would tell you how far to move and in which direction.
3709  Using Arduino / Project Guidance / Re: problems programing APM2 for quadcopter. on: November 02, 2013, 11:01:20 am
We would like to know how we can test simple programs(like a flashing LED) on this board to learn us work with arduino.

That's a sensible starting point.

Download and install the IDE. It comes with many examples that you can install and run on your Arduino.

If the type of Arduino you are is not one of the standard ones that the IDE knows about then you may need to create a new 'boards' entry for it. In that case I would expect the vendor of your board to provide the information you need to do that.
3710  Using Arduino / Project Guidance / Re: how to program the Arduino ds1820b ? on: November 02, 2013, 10:56:56 am
how to program the Arduino ds1820b

Once you spell the part number correctly, Google will take you to many worked examples showing how to read a temperature and print it to the serial port.
3711  Using Arduino / Project Guidance / Re: cheap WiFi module on: November 02, 2013, 10:51:47 am
For your first question, the answer is here:

http://www.lmgtfy.com/?q=cheap+WiFi+module+for+Arduino

For the second question, there are some Arduino clones with RF integral transceivers which support over-the-air programming, but I don't know of any WiFi ones. If all you want to alter is data then you could do that easily enough by including a feature in your sketch which enables it to receive data updates over the WiFi interface and save them locally, for example in EEPROM.

I suggest you get a prototype working before you worry about the economics of scaling up for production. It's pretty unlikely you would be using consumer parts by the time you get to production.
3712  Using Arduino / Project Guidance / Re: Digital or Analog inputs for DAQ ? on: November 02, 2013, 10:48:01 am
To be able to answer your question really needs an understanding of your overall system. Do you have / can you create a block diagram identifying the main components, the connections between them, and the nature of the signals on those connections? If, for example, you already have an async serial data stream carrying the data you want to log then two wires to an Ardulog would be all you need. In reality I doubt you will get that lucky, but knowing what data is available and what form it is available in has to be your starting point.
3713  Using Arduino / Project Guidance / Re: Cable Counter on: November 02, 2013, 10:43:08 am
You didn't say that you need to be able to measure the cable travel in both directions - I assumed it was just a dispenser. If it needs to be reversible then instead of using a single reed switch you would need two of them to act as a crude encoder with a resolution of one rotation. If you need a finer resolution than that, you would use a real encoder which would give you a resolution down to one or two degrees.

It is not sensible to measure the rotation of the spool itself because the amount of cable dispensed per revolution is not predictable. Use a separate idler pulley that the cable runs over. This also means you don't need to modify or attach anything to the supply pulleys - you just pass the cable through your gauge as it is dispensed.
3714  Using Arduino / Project Guidance / Re: Transfer of charge wirelessly via inductive coupling on: November 02, 2013, 10:33:07 am
Basically, can someone guide me towards using an oscillator with a coil, and calculating how a secondary could receive the power from the primary.

There's nothing stopping you from investigating if you're interested, but the problem of wireless electromagnetic power transmission is one that has had a lot of money invested in it in the past few years and still hasn't been solved well enough to make a viable product. The problem requires you to understand how magnetic fields are generated and propagated and how to direct and focus them. If you're trying to do it by connecting a DC power source to a coil this suggests to me that you are several years of education away from understanding this well enough to get anywhere.

If you're willing to consider a less ambitious project then you could just take the base and charging coil from a rechargeable electric toothbrush, connect the coil output to a boost converter and see over what sort of distance you can transfer enough power to operate an LED. I think it'll fall well short of 4" but you never know 'til you try.

If you decide to take your investigation further than that then you don't need an Arduino - you need an electronics lab.
3715  Using Arduino / Project Guidance / Re: Controlling Stepper Motor CW and CCW thru inputting the degrees using 4x4 Keypad on: November 01, 2013, 10:51:45 pm
I get what you're trying to do, but it's obviously incomplete and the logic of handling the reset button doesn't look quite right. Also, you don't set confirm back to false after you have sent the command to the stepper motor.

To start with I suggest you ignore the stepper motor and concentrate on getting the keypad input logic right, and print out the value of digit1 and digit2 after each button press so that you can see what effect it has had. Keeping the same architecture you have currently, I think the logic ought to be something like this:

Code:
  if(digit1 < 0)
  {
  // we're setting digit1
  switch(key)
  {
  case '0' ... '9':
  digit1 = key - '0';
  break;
  case '#':
  // no action - confirm not applicable when entering first digit
  break;
  case '*':
  // no action - cancel not applicable when entering first digit
  break;
  }
  }
  else
  {
  // we're setting digit2
  switch(key)
  {
  case '0' ... '9':
  digit2 = key - '0';
  break;
  case '#':
  confirm = true;
  break;
  case '*':
  // cancel previous digit
  digit1 = -1;
  break;
  }
  }

What is the stepper motor intended to do, by the way? Are you trying to move it by a specified distance, or move it to a specified position?
3716  Using Arduino / Programming Questions / Re: while(!Serial) in setup, leonardo on: November 01, 2013, 10:06:49 pm
The while(Serial) loop is NOT waiting for you to open the Serial Monitor. It is waiting for the USB to Serial chip to report that it us ready. That chip gets ready pretty quick.

I don't have a Leonardo, but my understanding from other people's comments here and supported by the documentation for the board is that on the Leonardo the Serial operator bool() returns true when the virtual serial port at the far end of the USB/serial connection has been opened i.e. when the serial monitor has been opened.

Quote from: Guide to the Arduino Leonardo and Micro
Unlike the Arduino Uno, the Leonardo and Micro won't restart your sketch when you open a serial port on the computer. That means you won't see serial data that's already been sent to the computer by the board, including, for example, most data sent in the setup() function.

This change means that if you're using any Serial print(), println() or write() statments in your setup, they won't show up when you open the serial monitor. To work around this, you can check to see if the serial port is open like so:

// while the serial stream is not open, do nothing:
   while (!Serial) ;
3717  Using Arduino / Programming Questions / Re: NRF24L01+ Fails to send, but is receiving fine! (Using RF24Network lib) on: November 01, 2013, 08:14:48 pm
same results.... smiley-cry((

Obviously that can't be literally true since the previous sketch printed the success rate and the ping pair one doesn't.

What actually happens - what proportion of the sender writes are received at the receiver, and what proportion of the send writes report success, and what proportion of the successful writes result in a response being received and what proportion of those responses are indicated as successful by the return status of the receiver's write call?

There are lots of messages being sent and received in a simple 'ping' operation, and you need to work out which ones are failing. The successful sequence should look something like this:

Quote
A calls radio.write().
    A sends message to B and waits for response.
    message received at B
    B sends ack message
    A receives ack message
radio.write returns success status

B processes received message from A
B calls radio.write to send response
    B sends message and waits for response.
    message received at A
    A sends ack message
    B receives ack message
radio.write returns success status
3718  Using Arduino / Programming Questions / Re: else statement is not working ! on: November 01, 2013, 08:03:34 pm
what do you mean ?

He means let the editor change all the occurrences of a variable name for you rather than trying to find and correct them manually. Because the existing names are so poor, there's a good chance when doing it manually that you would make mistakes.
3719  Using Arduino / Programming Questions / Re: How to perform a ethernet request locally on: November 01, 2013, 08:00:59 pm
Additionally, I recommend that you improve your code layout. Put each { and } on separate lines with matching pairs indented by the same amount and lines between them indented one extra level. Always follow if, else, do, while, for with a compound statement enclosed in { and } even if there is only one statement in it. The tools/autoformat command can be used to correct the indentation.
3720  Using Arduino / Programming Questions / Re: No satisfactory place to define variables? on: November 01, 2013, 07:56:20 pm
Quote
in this context 'global' just means global to the compilation unit that you have defined them in.
Um.  No.
In fact, it is a significant problem in "large C programs" when multiple compilation units define global variables with the same name.  The linker doesn't necessarily do what you'd expect.


Um. Yes.

If you want your global data to be local to a compilation unit, give it internal linkage by declaring it static. If you want to share it between compilation units, give it external linkage and use some other technique to avoid name collision. For example you can put it in a class, or in a namespace, or in a class in a namespace ... The bigger your solution is the more effort you need to put into addressing this sort of issue and managing the resulting complexity but there are solutions which will scale up as big as you want - certainly far beyond what you would ever run on an Arduino.
Pages: 1 ... 246 247 [248] 249 250 ... 837