Show Posts
Pages: 1 2 3 [4] 5 6 ... 844
46  Using Arduino / Project Guidance / Re: Having Arduino and Gobetwino wait for eachother to continue on: August 04, 2014, 10:57:02 am
I want Arduino to wait until the measurement is finished

What options are available to you to tell when the measurement is finished?
47  Using Arduino / Project Guidance / Re: Robot arm project guidance wanted (transistors) on: August 04, 2014, 08:01:24 am
I'm not sure about the current, I don't have an ammeter but I'd be willing to get one if it could help me with Arduino in the future.

It's an invaluable tool and well worth having if you expect to do any significant work with electrics or electronics, and essential for this particular problem since you need to know the electrical characteristics of the circuit you're connecting in to in order to connect in to it successfully.

If the current required is below about 40mA there's a chance you could drive it directly from an Arduino I/O pin. Otherwise you're going to need a driver circuit. What sort of circuit will depend on the voltage and current you're trying to switch. You absolutely need to know that before you go any further.
48  Using Arduino / Project Guidance / Re: Measuring distance with RF on: August 04, 2014, 07:53:02 am
I stuck a Serial.prinln(currentMillis) into my sketch

I think you're barking up the wrong tree. To work that out for yourself, calculate what sort of timing resolution and accuracy you need to achieve, and then look at the realistic chances of achieving that on your Arduino.

If you're looking for resolution in terms of meters rather than kilometers I doubt the Arduino will be able to do it in hardware running at 16MHz. I'm even more skeptical that it can be done in software. Doing it using a polled architecture is even less likely to work. A polled architecture with print statements in the polling loop is substantially less likely to work.
49  Using Arduino / Programming Questions / Re: Time measurement with timer 1 on: August 03, 2014, 01:44:42 pm
Now I wish to do the opposite, get familiar with the concept of time measurement using the timer.

This isn't an particularly sensible approach unless the pulses you're trying to read are arriving faster than can be read successfully using interrupts, or the timing resolution you need to achieve is better than 4 microseconds.
50  Using Arduino / Project Guidance / Re: Robot arm project guidance wanted (transistors) on: August 03, 2014, 12:15:17 pm
I aim to connect the 8 pins on the PCB to a breadboard, when current can travel between any of the motor pins and the positive terminal pin the corresponding motor will turn in one direction, they will turn in the opposite direction when current flows between their pin and the negative terminal pin. The LED lights up when the LED pin is connected to the negative terminal pin.

Are you saying there is a single terminal which makes a given motor turn one way when it is connected to positive and turn the other way when it is connected to ground? If so there must already be some form of driver circuit on the 'motor' side of that circuit. How much current flows through that terminal when you connect it to positive, and to ground?
51  Using Arduino / Project Guidance / Re: Arduino to Raspberry Pi over WiFi on: August 02, 2014, 09:18:33 am
The're about one euro each on ebay - 500metre range

The one euro ones will be unamplified and will have a range nearer to 5m than 500m. The amplified units cost more (but are still relatively inexpensive) but are a bit harder to use since they require external power.
52  Using Arduino / Programming Questions / Re: Using multiple serial ports in Arduino due on: August 02, 2014, 07:23:13 am
Unfortunately, now the code is not working. I am just a beginner. Please help!!!  smiley-sad-blue

If you want help with a code problem you need to post real code, not a redacted version. Write a test sketch that demonstrates the problem in the simplest possible way without any extraneous code, and post that in its entirety in code tags, together with the complete compiler output if it's a compilation problem or a description of what you expected it to do and what it actually does if it's a runtime problem.
53  Using Arduino / Project Guidance / Re: I SUPPOSE I CAN'T USE ID-12 PROPERLY on: August 02, 2014, 06:28:19 am
You don't say what Arduino you have or how the reader is connected to the Arduino, but from the code I guess you are trying to use the same hardware Serial port to communicate with the Arduino serial monitor and with the RFID reader.

That's not a good idea - the serial port is designed to have one device sending at each end, and when you connect two devices, they just end up fighting against each other. If you have the RFID reader connected to pins 0 and 1, change that to use a different serial port. If your Arduino hasn't got an more hardware serial ports, you can use a software serial port.

Once you have it wired correctly, find out what speed, parity and start/stop bits the RFID serial port defaults to and make sure your sketch uses the same settings.
54  Using Arduino / Project Guidance / Re: Can USB Host Shield support USB hub? on: August 01, 2014, 06:15:05 am
I would like to connect a USB hub to a USB Host Shield. And then each USB port will be connected to different Arduinos.

I am just wondering whether would that be possible?

I don't think it is possible to use a USB hub to connect one device to multiple hosts. USB hubs are designed to connect multiple devices to a single host, not the other way around. If you can explain what you're trying to achieve, perhaps somebody can suggest a better way to achieve it.
55  Using Arduino / Project Guidance / Re: Using interrupts to output a square wave of variable frequency. on: August 01, 2014, 06:09:59 am
If you particularly want to use interrupts then you need to configure a hardware timer to trigger the interrupt at the required frequency. You can use the Timer1 library to do this, or write your own code to access the hardware directly. But you can probably achieve this just by configuring the hardware timer to output the square wave directly onto an I/O pin i.e. not using interrupts at all.
56  Using Arduino / Programming Questions / Re: Can't user Serial1 and Serial when cable is not connected on: July 30, 2014, 11:51:15 am
The problem comes when I don't connect the USB cable to the PC and then I power it on with battery. Everything switches ON, and I can see the lights working Okay. But, I've no response of the board on my internet service... So, I guess the problem is the Serial1 communication with the mobile board

There is a common convention of putting code in setup() which waits until the Serial port has initialised. On some boards, this will block the sketch until a PC application opens the serial port:

  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only

If you have this code in your setup() function, I suggest you take it out.

I am sure Serial1 becomes Serial when USB cable is not connected...

I am sure it does not.
57  Using Arduino / Programming Questions / Re: x +=y; is the same as x=x; ??? on: July 30, 2014, 11:45:23 am
so the short version is that I am trying to do a running average with code like this:

Please post a complete sketch that demonstrates the problem - preferably one that demonstrates it in the simplest possible way without relying on any external hardware or non-standard libraries. Explain what your input values are, what output value you expect and what output values you actually get.
58  Using Arduino / Project Guidance / Re: Help with how to approach my aquarium controller on: July 30, 2014, 11:40:47 am
This is how it determines which button is pressed, do you have any pointers on how I could perhaps do this another way?

It seems that your shield is combining all the buttons with a resister network so the Arduino sees a different voltage on an analog pin depending which buttons are pressed. The code to handle this type of input is similar to reading an ordinary pushbutton on a digital I/O pin, except that it can return multiple values not just high and low. In order to detect button presses you need to keep track of what button is currently pressed, and see when this changes.

// global data
int previousButton = btnNONE;

// code called from loop()
currentButton = read_LCD_buttons();
if(currentButton  != previousButton)
    // button press or release has occurred
    if(currentButton != btnNONE)
        // button press has occurred
    previousButton = currentButton;

// function you will write to do something when a button press occurs
void handleButtonPress(int button)
    your code here
59  Using Arduino / Project Guidance / Re: Parsing JSON from serialized data on: July 30, 2014, 11:30:26 am
How can I parse {"win":"yes"} out of the serialized data in arduino?

Do you want both fields, or just the "yes" string?

For each field you want to keep, you need to read and discard everything up to the start of that field and then read and buffer everything up to the end of the field. Since the fields are delimited by unique character sequences {", ":", "} that is easy to do. You can do it either using a little state machine to keep track of where you are in the parsing sequence, or by buffering the whole lot and using strstr() to detect where the delimiters are within the buffer and then using strncpy() to extract the part you want to keep into a separate buffer.

If you only want to know whether the value is "yes" or "no" it gets even easier - you can just use strstr() to test whether the input buffer contains \"win\":\"yes\" or \"win\":\"no\".

60  Using Arduino / Project Guidance / Re: RC controller stick input bypass on: July 30, 2014, 11:18:44 am
How about using a micro servo or similar to adjust the trim? Usually this works by physically moving the body of the potentiometer. You may need to hack the mechanism to achieve a sufficient range of motion. Alternatively if you only need a few discrete movements you could use a micro relay to connect a resister in series with the pot to bias the pot output. I don't know how much current the pots take, but if it's of the order of 20mA or so you could even use I/O pins directly to add pull-up/pull-down resistance to the signal pin.
Pages: 1 2 3 [4] 5 6 ... 844