Show Posts
Pages: [1] 2 3 ... 61
1  Using Arduino / Project Guidance / Re: What IDE Should I use? on: February 05, 2014, 06:32:46 pm
Hello and welcome,

The (3) is the one I recommend for beginners.

(1) and (2) are the same thing, and (3) is very similar but with some useful features added.

There are some other options, for example using Visual Studio and this: http://visualstudiogallery.msdn.microsoft.com/aff7d8be-02a2-4afb-b5c9-3c32e89825e5

But requires VS Pro...
2  Using Arduino / Programming Questions / Re: pulling information out of array and strtok on: January 30, 2014, 04:17:28 pm
Code:
if (sscanf(str,"%2s%d:%2s%d%2s%d:%2s%d%2s%d:%2s%d", s1, &n1, s2, &n2, s3, &n3, s4, &n4, s5, &n5, s6, &n6) == 4)

The Serial message is contained in input, not in str.

Also you are expecting 12 values, not 4!

Don't just copy/paste, the code I wrote on codepad wasn't meant to be copy/pasted in an arduino sketch. You copied everything, including main() and return, while you should have copied only what is between. Or do not copy at all, instead try to understand and do it yourself (as you said)
3  Using Arduino / Programming Questions / Re: pulling information out of array and strtok on: January 29, 2014, 04:07:49 pm
Serial.read() will read only one character.

Here is the method I use for reading all characters, until a "\r" is found (so if you use this code you must setup your serial monitor to add a "\r" line ending):

Code:
void loop()
{
  if ( Serial.available() > 0 )
  {
    static char input[64];
    static uint8_t i;
    char c = Serial.read();

    if ( c != '\r' && i < 64-1)
      input[i++] = c;

    else
    {
      input[i] = '\0';
      i = 0;
      
      // Now input contain the whole Serial message without the last "\r", so place your sscanf code here
      Serial.println( input );
    }
  }
}

Here is a good article to read: http://www.gammon.com.au/forum/?id=11425
4  Using Arduino / Programming Questions / Re: pulling information out of array and strtok on: January 29, 2014, 01:20:56 pm
NP, and just in case you didn't know, in C/C++, arrays are always passed by reference to a function, that's why it is not necessary to put a "&" in front of s1 and s2.
5  Using Arduino / Programming Questions / Re: pulling information out of array and strtok on: January 29, 2014, 01:12:33 pm
It mean this:

Check for 2 characters (which will be stored in s1), followed by a number (which will be stored in n1), followed by ":", followed by 2 characters (which will be stored in s2), followed by a number (which will be stored in n2)

And then check if the function has stored 4 values. If not, then it mean the "command" was invalid. When in doubt, just type "sscanf" in google smiley-kitty
6  Using Arduino / Programming Questions / Re: pulling information out of array and strtok on: January 29, 2014, 12:58:36 pm
Hi, sscanf is your friend smiley-wink

Exemple: http://codepad.org/RuGX7tfe

Edit: then you use strcmp to check if s1 equal "c1" or whatever
Code:
if (!strcmp(s1, "c1"))
{
    ...
}
7  Using Arduino / Programming Questions / Re: Problem creating a message with variables on: January 22, 2014, 05:44:18 am
Or strcat maybe.

To use sprintf with floats you have to do: http://forum.arduino.cc/index.php?topic=124809.msg954691#msg954691 , or use dtostrf
8  Using Arduino / Project Guidance / Re: Convert char string into char array on: January 22, 2014, 04:50:45 am
Hello,

If 'A1' is sent from the PC, the whole thing gets saved in defined variable only (using this "var = Serial.read()")

This is not possible because Serial.read() only read one character.

A "char string" is already a char array. Post your code.
9  Using Arduino / Project Guidance / Re: Power management using arduino and zigbee on: January 22, 2014, 04:36:26 am
Define "many", but yes it will be possible, even if an Arduino Mega isn't enough for you, you can increase the amount of IO by using shift registers and/or multiplexers

Here is an example breadboard for controling 16 LEDs with only 4 arduino IO pins and 2 shift registers (74HC595):

10  Using Arduino / Project Guidance / Re: Automated liquor dispenser on: January 21, 2014, 06:22:51 pm
I will speak for Bluetooth because I have no experience with Wifi... But I agree that doing the UI on the smartphone will probably be the hardest part of your project.

For a start, using the module I suggested and the Android App named BlueTerm, you can easily send serial commands from your smartphone to the Arduino (and also send reply from arduino to smartphone if needed).

Also search on the Play Store for "arduino bluetooth", you will find tons of interesting things.

So basically all you need to buy is the Bluetooth module, and relays if you don't have them already.

BlueTerm source code: http://pymasde.es/blueterm/

11  Using Arduino / Project Guidance / Re: Automated liquor dispenser on: January 21, 2014, 05:33:44 pm
It should be easy enough.

It is unclear what you want to do exactly, wireless: do you want both physical buttons wired to the arduino and wireless so you can also control it from PC/Smartphone? Or what?

For now I suggest you put aside relays, pumps and wireless. Start with LEDs and buttons. When the code is working as it should, add relays instead of LEDs, then add pumps, tweak the code if needed. Finally add wireless. Do one step at a time smiley

I can recommend Bluetooth slave module "JY-MCU HC-07", I use it, it's cheap and it works great.
12  Using Arduino / Project Guidance / Re: Smartest approach to uploading a sketch to several hundred Mega 2560's? on: January 21, 2014, 03:37:52 pm
With the Arduino Enhanced IDE ( http://forum.arduino.cc/index.php?topic=118440.0 ), in the Sketch menu there is option "Show compilation folder". Here you will find the .hex file that will be uploaded to the Arduino. You can then upload it, using avrdude. Hope this helped a bit smiley-wink

Note that I never tried avrdude yet, so I have no idea about which command line to use.
13  Using Arduino / Project Guidance / Re: Example 02 from "Getting Started with Arduino" on: January 21, 2014, 03:13:42 pm
smiley-eek Your wiring is totally wrong. Actually each of your wires doesn't connect to anything. You don't understand how a breadboard works? It has rows and columns, like in this picture (except the row at the middle):


Here is how you connect a button that will blink the onboard LED: http://arduino.cc/en/tutorial/button
14  Using Arduino / Project Guidance / Re: Help to display temp, humidity and ph on ITDB02 screen on: January 21, 2014, 02:47:44 am
You never break your while(1) loop, so it will run infinitely. But do you even need this loop? I don't think so.

Copy/pasting without trying to understand, is really a bad idea smiley
15  Using Arduino / Project Guidance / Re: Bluetooth - quick power up and down every second on: January 10, 2014, 08:18:30 am
Searching and connecting a Bluetooth device will most likely take more than one second.
Pages: [1] 2 3 ... 61