Loading...
  Show Posts
Pages: 1 [2] 3 4 ... 442
16  Using Arduino / Programming Questions / Re: help Lamp RGB with pmw on: June 17, 2013, 10:38:49 pm
If you start with brightnessRed = 0 and keep adding 2 to it you will never hit 255, only 254 and 256.  Your code checks for exactly 255.

Typically you would put something like this in where you increment the brightness:

Code:
    if (brightnessRed + tonoRojo > 255)
        brightnessRed = 255;
    else
    if (brightnessRed + tonoRojo < 0)
        brightnessRed = 0;
    else
        brightnessRed += tonoRojo;
    analogWrite(pinRed,brightnessRed);
    break;

Similarly for green and blue.
17  Using Arduino / Networking, Protocols, and Devices / Re: UDP.write not recognizing strings on: June 17, 2013, 10:30:36 pm
The .write() method can take three kinds of arguments:

   char  (a single character)
   char * (a pointer to a null terminated list of characters)
   char *, int  (a pointer to characters and a count of how many characters)

To use a String object you need to convert it to one of those types.  You can use .getBytes(buffer, length) or .toCharArray(buffer, length) but in both cases you need to create a character array buffer:

Code:
    String myString = String(j);
    char buffer[100];
    myString.getBytes(buffer, 100);
    Udp.write(buffer, myString.length());
18  Using Arduino / Programming Questions / Re: How to find a string on text file, and write after a "," comma a value on: June 17, 2013, 10:17:19 pm
I just can't understand why abc goes to the end of file and xyz goes to the right line...

When you open an existing file to write more into it the file pointer is positioned to the end of the file so the new data goes AFTER and not ON TOP OF the old data.

See: http://arduino.cc/en/Reference/SDopen
Quote
mode (optional): the mode in which to open the file, defaults to FILE_READ - byte. one of:
FILE_READ: open the file for reading, starting at the beginning of the file.
FILE_WRITE: open the file for reading and writing, starting at the end of the file.

Use file.seek(0) to set the position to 0 and your file.find() will start looking from the start of the file.

http://arduino.cc/en/Reference/FileSeek
19  Using Arduino / Audio / Re: wtv020-20s schematic on: June 17, 2013, 03:58:27 pm
I agree that the pin definitions in the software do not match the pin connections shown in the schematic.

Good luck figuring out which is correct (if either of them is).
20  Using Arduino / Sensors / Re: Sensing relay state or current flow on: June 17, 2013, 03:49:36 pm
Did I recommend an A1301?  I just pointed you at a tutorial.  You should ask the tutorial author why they used the A1301 in their tutorial.

My understanding is that you have a choice between a "Hall Effect Sensor" and a "Hall Effect Switch".  The "Sensor" gives you a signal proportional to the magnetic field.  The "Switch" gives you a simple HIGH/LOW signal based on some threshold.

I would think you would want a "Sensor" instead of a "Switch".  That way you could detect when the fans or pumps were drawing more than the usual current: a possible sign of a bad bearing or blockage of some kind.
21  Using Arduino / Motors, Mechanics, and Power / Re: how to control 15 motors 0f 10A 12v motors on: June 17, 2013, 03:13:51 pm
I'm not sure but I think the intersil ISL83204A can drive four N-channel MOSFETS in a Full Bridge configuration.

http://www.intersil.com/en/products/power-management/mosfet-drivers/half--full-bridge-and-three-phase-drivers/ISL83204A.html
22  Using Arduino / Sensors / Re: Sensing relay state or current flow on: June 17, 2013, 02:52:40 pm
You can always coil the power wire to get more magnetic flux.  Give it a try!
23  Using Arduino / Sensors / Re: Sensing relay state or current flow on: June 17, 2013, 11:57:40 am
You could try a Hall-effect magnetic field sensor to detect the magnetic field caused by current flow.

http://playground.arduino.cc/Code/HallEffect
24  Using Arduino / Sensors / Re: Looking for a cheap wind sensor on: June 17, 2013, 11:53:11 am
Well, there's this: http://shop.moderndevice.com/products/wind-sensor
25  Using Arduino / Storage / Re: SdFat, insert text before another text on: June 17, 2013, 11:41:08 am
If you want to inset data in the middle of a file you typically have to copy the first part of the source file to a new file, write the part to be added, then copy he remainder of the source file.  Then you can delete the source file and re-name the new file to have the name of the source file.
26  Using Arduino / Motors, Mechanics, and Power / Re: how to control 15 motors 0f 10A 12v motors on: June 17, 2013, 11:35:13 am
and i found this any one could please give some review about this product
http://robokits.co.in/shop/index.php?main_page=product_info&cPath=73&products_id=334

Note that the manual says it can handle 10A but only for up to 10 seconds (20A for up to 1 second). For continuous use it's rated for 5A.  You can improve these numbers by adding heat sinks to the mosfets.
27  Development / Suggestions for the Arduino Project / Re: seconds timekeeping on: June 17, 2013, 11:22:37 am
It does not wrap after a few days like millis() does.

The millis() timer wraps after about 47 days.  The version I wrote should work properly across the wrap so unless you are measuring a single interval greater than 46 days it shouldn't be a problem.
28  Using Arduino / Audio / Re: wtv020-20s schematic on: June 17, 2013, 11:08:50 am
I can't find WTV020-20S on that website.  Do you have a URL for it?
29  Using Arduino / Programming Questions / Re: weird comparison on: June 17, 2013, 10:58:26 am
is this statment [  if((data>>i) & 0x0001 >0)  ] same as [ if((data>i) && 0x0001 >0) ] ?

No.

>> is the Shift Right operator and & is the bitwise AND operator.

It's testing bit 'i' of data, equivalent to:

Code:
if (data & (1<<i))
30  Using Arduino / Project Guidance / Re: 2560 pin 49 and 48 on: June 17, 2013, 10:51:19 am
The pin layout is specific to each 'variant' and the boards.txt file specifies which variant to use for each board.  In the sketchbook ('Arduino') folder there is a 'hardware' folder. Inside that you create a folder for your board. In that folder you put your boards.txt file and a folder called variants.  In that variants folder you put a folder for your board. Inside that you put a pins.h file to do the pin mapping.

Look at the ATtiny support from the High-Low-Tech project at MIT to see how it's done.
Pages: 1 [2] 3 4 ... 442