Show Posts
Pages: 1 ... 5 6 [7] 8
91  Using Arduino / Project Guidance / Re: SERIAL COMMUNICATION on: August 21, 2012, 06:58:57 am
Connect TX of one to RX of the other, and vice versa.  Then write code to send and receive data as necessary.  Without knowing more about what you want to do, it's not possible to be more specific in an answer.
92  Using Arduino / Project Guidance / Re: custom PCB's on: August 20, 2012, 07:08:23 am
They aren't in the UK, but Seeedstudio and Iteadstudio will each do ten 5 cm x 5 cm boards (2-layer, green soldermask, SMD or not doesn't matter), for $10 US plus shipping.  Shipping from China to the UK might be cheaper than to the US.
93  Using Arduino / Programming Questions / Re: Ok, here is the problem. on: August 17, 2012, 10:02:33 pm
I don't have a Libraries folder.
Yes, you do--several of them, most likely, but the one that's relevant is in /Users/<you>/Documents/Arduino.  The contents of any add-on libraries you want to use should go there, each in its own folder.
94  Using Arduino / Project Guidance / Re: Arduino to custom board on: August 15, 2012, 05:56:20 am
For low-volume fab houses, I've seen recommendations for three:
batchpcb.com ($10 setup fee, $2.50/in^2)
oshpark.com ($5/in^2 for 3 copies)
Seeedstudio.com ($10 for 10 ea., 5x5cm boards)
95  Development / Other Hardware Development / Re: Found a place for cheap pcb manufacturing on: August 14, 2012, 11:25:23 am
From what I've seen, Iteadstudio and seeedstudio are offering the same services (except for 4-layer with seeedstudio) for the same prices--wonder if they're the same folks.  How have your experiences been with iteadstudio?
96  Development / Other Hardware Development / Re: Found a place for cheap pcb manufacturing on: August 14, 2012, 08:00:34 am
http://www.seeedstudio.com/depot/fusion-pcb-service-p-835.html?cPath=185 also looks like a pretty good deal for boards.  They're in pre-set sizes, and it's a minimum of 10, but 10 ea., 5x5cm boards are $10.

BatchPCB.com will do any quantity you want.  $10 setup, then $2.50/in^2 with a minimum of one in^2 (but after that first in^2, they don't round up on the board size).
97  Using Arduino / Storage / Re: Name your Text(.txt) file with the actual date on the SD card for logging on: August 06, 2012, 05:48:50 pm
Here's the code I've used to do something similar:
Code:
#include <Wire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <SdFat.h>

char logFile[13];
void setup() {
  time_t t = now();
  int yr = year(t) - 2000;
  sprintf(logFile,"%.2d%.2d%.2d00.csv",
  yr, month(t), day(t));
    if(myFile.open(logFile,O_RDWR | O_CREAT | O_AT_END)) {
stuff...
  }
  else {
  error
  }
}

Of course, if you wanted a four-digit year, you'd dispense with the int yr declaration and just use year(t) in the sprintf statement.
98  Using Arduino / Storage / Re: Name your Text(.txt) file with the actual date on the SD card for logging on: August 06, 2012, 01:06:50 pm
I'm not sure why you're setting file_today_name[30] when the maximum length of a filename is 12 characters (8.3).  Seems file_today_name[13] would be adequate, and save a few bytes of RAM.  Am I missing something?
99  Using Arduino / General Electronics / Re: Very Basic Breadboard Question on: July 30, 2012, 05:44:34 pm
On each row, columns A-F and G-L are connected together.  So, A1, B1, C1 ... F1 are connected together, and G1 ... L1 are connected together.  Ditto for A2 ... F2 and G2 ... L2, etc.  Right now, this means you have the resistor connected to itself, and not to anything else.  Not too useful.

Try these connections:  Short leg of the LED into the ground bus.  Long leg of the LED into C1.  One leg of the resistor (doesn't matter which; resistors aren't polarized) into D1 (this connects it to the long leg of the LED--remember A1 ... F1 are connected together).  Other leg of the resistor into D3.  Wire from A3 to the positive bus bar.

Presuming your resistor is a reasonable value (i.e., somewhere around 220 ohms up to maybe 1k), this should make the LED light up whenever the bus bars have power/ground from the Arduino.
100  Using Arduino / Programming Questions / Re: Time library issue on: July 27, 2012, 08:08:45 am
There's no need to go mucking about with the application folder.  User-added libraries are, indeed, stored in ~/Documents/Arduino/Libraries, each in a folder there.  So, in Libraries, you should have a folder for Time.  That folder should contain, at least, two files (Time.h and Time.cpp), and should also have another folder for examples.

You do not need to compile the library; it's already compiled.  What are all the errors returned when you try to compile the example?
101  Using Arduino / Project Guidance / Re: Alarm system on: July 18, 2012, 06:27:08 am
If you're trying to create an alarm system that has sensors outside, that generally isn't too good of an idea--there's a high risk of false alarms from stray animals, weather conditions, etc.  What are you trying to do?
102  Using Arduino / Programming Questions / Re: Want to create one file, but it's making two on: July 16, 2012, 10:21:24 am
Got it.  That also helps explain why I couldn't see anything wrong with my code--there wasn't.  It was the reset behavior (that I wasn't aware of) that was doing it.  I'm learning, little by little.
103  Using Arduino / Programming Questions / Re: Want to create one file, but it's making two on: July 16, 2012, 05:24:39 am
The delay did it.  Thanks!  Never would have guessed that one.
104  Using Arduino / Programming Questions / Re: Want to create one file, but it's making two on: July 15, 2012, 09:18:50 pm
Fixed.  So much for the "Copy for Forum" function in the Arduino software...
105  Using Arduino / Programming Questions / Want to create one file, but it's making two on: July 15, 2012, 07:21:43 pm
Working on a data logging project, and I want to create log files with filenames in the format of yymmddnn.csv, where nn is a sequential number from 00 to 99, and should be a new file (i.e., I don't want to overwrite or append to an existing file).  For some reason, though, my sketch is finding the first unused file name, creating that, and then creating the next one too.  Here's the code:

Code:
//test file creation with date and sequence number

#include <Time.h>
#include <SdFat.h>

const int SdChipSelect = 0;
int i = 0;
char logFile[13];
SdFat sd;
SdFile myFile;

void setup()
{
  Serial.begin(38400);
  setTime(1341963000);
  if (!sd.init(SPI_HALF_SPEED, SdChipSelect))
  {
    Serial.println("SD Init failed!");
  }
  else
  {
    if(!sd.chdir("/logs/")) Serial.println("Failed to chdir /logs/");
    time_t t = now();
    int yr = year(t) - 2000;
    sprintf(logFile,"%.2d%.2d%.2d00.csv",
    yr, month(t), day(t));
    logFile[12]=0;
    for (i = 0; i < 100; i++)
    {
      logFile[6] = i/10 + '0';
      logFile[7] = i%10 + '0';
      if (sd.exists(logFile))
      {
        continue;
      }
      if(myFile.open(logFile,O_RDWR | O_CREAT | O_AT_END))
      {
        Serial.print ("Opened for writing: ");
        Serial.println(logFile);
      }
      else
      {
        Serial.print("Failed to open ");
        Serial.println(logFile);
      }

      break;
    }
  }
}

void loop()
{
}




...and here's the output on the serial monitor:

Quote
Opened for writing: 12071001.csv
Opened for writing: 12071002.csv

The two files are, in fact, created on the SD card as well.

I'm sure I'm missing something simple here--how do I get it to just create one file?
Pages: 1 ... 5 6 [7] 8