Show Posts
Pages: 1 [2] 3 4 ... 13
16  Using Arduino / Project Guidance / Re: Spectrum Analyzer - new to hardware - on: May 03, 2013, 08:33:42 am
Have you hooked up the microphone and looked at the output of the FFT on your serial monitor?
17  Using Arduino / Project Guidance / Re: Gobetwino reading problem on: April 23, 2013, 09:48:57 pm
The .flag extension is just a personal choice, you could make the extension whatever you want, .out .txt .lck whatever.  It's similar to the lock files that keep two people from opening Microsoft office files.  To read it you would need to make another gobetwino function.
18  Using Arduino / Project Guidance / Re: Gobetwino reading problem on: April 15, 2013, 03:25:32 pm
For a little more background
http://arduino.cc/forum/index.php/topic,157724.msg1181262.html#msg1181262
http://arduino.cc/forum/index.php/topic,153032.msg1147826.html#msg1147826

You're gonna have issues not ending up with synchronization issues going this route.  Either Matlab will have the file open while arduino tries to read it or vice versa.  What you can do is create a dummy file that is empty to signal if Matlab has the file open, and another for when the arduino is reading the file.  You can get really fancy had have just one file with the first line being and index of the program that is currently reading output.txt, 1 for Matlab 2 for arduino.  Then the process is this:
Matlab:
Code:
if(first line of flag file is a 2){
       wait;
    }else{
       put a 1 in the first line of flag file
       open output.txt
       put data into output.txt
       close output.txt
       put a 0 in the first line of flag file //or delete flag file
    }
arduino:
Code:
if(first line of flag file is a 1){
       wait;
    }else{
       put a 2 in the first line of flag file
       open output.txt
       read data from output.txt
       close output.txt
       put a 0 in the first line of flag file //or delete flag file
    }

This is really cludgy but you have been really averse to using the other methods, so it may be the easiest thing to do.
19  Using Arduino / Project Guidance / Re: remote sensors - wich (wired) connection is better? on: April 05, 2013, 07:48:11 am
You wouldn't be using an "arduino" per se, you would be using an atmel chip at each light.  This would be a barebones type board.  An ATTINY 45/85 or 44/84 is perfect for this sort of thing.
20  Using Arduino / Project Guidance / Re: How do you take your Arduino project to mass production? (or mass-ish) on: April 05, 2013, 07:44:21 am
It really depends on the type of components you are using in your end product.  Most things will be SMD components.  This means a smaller package, but much more difficult to solder.  You can however get through-hole components.  These are pretty much the type of components you used in your prototype, but you end up soldering it to your board.  Depending on your client base you can always sell your product as a kit, assembly required.
21  Using Arduino / Project Guidance / Re: How do you take your Arduino project to mass production? (or mass-ish) on: April 04, 2013, 01:48:57 pm
You'll more than likely want to take your arduino concept and create your own PCB board.  This will eliminate most of the loose cables that you are talking about.  Then you'll want to add some shock absorption into your case to help dissipate shock loads.
22  Using Arduino / Project Guidance / Re: Serial Communication with Netbeans and Arduino. on: April 04, 2013, 09:54:49 am
I'm not sure why you want to used those libraries anyways.  Getting java to work with serial ports is really easy without it.
23  Using Arduino / Project Guidance / Re: Desktop PCB production on: April 04, 2013, 09:37:55 am
Here is a nice step by step guide, with videos of how one company does PCB manufacturing.  They use photo-resist, and electroplating.  Might give you some ideas.
http://www.eurocircuits.com/index.php/making-a-pcb-eductional-movies/35-front-end-tool-data-preparation-
24  Using Arduino / Project Guidance / Re: Desktop PCB production on: April 04, 2013, 09:24:19 am
If you wanted to go the electroplating route you could first use conductive paint to mark out your traces, then use electroplating to make those traces thicker.
25  Using Arduino / Project Guidance / Re: Desktop PCB production on: April 04, 2013, 09:02:18 am
Sintering would require pressure and temperature.  You'd probably want to look more at some kind of paste as opposed to a powder.
26  Using Arduino / Project Guidance / Re: Desktop PCB production on: April 03, 2013, 10:19:21 pm
You'd want to fuse your conductor to itself first then adhere it to your non-conductive board.
27  Using Arduino / Project Guidance / Re: Desktop PCB production on: April 03, 2013, 10:05:04 pm
There are also methods for etching that don't use caustic chemicals.  I'm not sure how effective conductive ink would be but you could do something like rapid prototyping with copper.
28  Using Arduino / Project Guidance / Re: Desktop PCB production on: April 03, 2013, 09:13:46 pm
you could always use a CnC to mill out a PCB board
29  Using Arduino / Project Guidance / Re: Little problem with gobetwino on: April 03, 2013, 08:37:46 pm
I'm glad that I could help.  It was just an issue of your arduino code getting ahead of your serial buffer.
30  Using Arduino / Project Guidance / Re: Little problem with gobetwino on: April 03, 2013, 04:43:37 pm
Add a slight delay after the log command to wait for it to finish
Code:
int serInLen = 25;
int ledGreen = 8; // Groene led op pin 8
int ledRed = 4;  // Rode led op pin 4
char serInString[25];

void setup()                   
{
  pinMode(ledGreen, OUTPUT); 
  pinMode(ledRed, OUTPUT);
  Serial.begin(9600);
  Serial.println("#S|OPENCAMERA|[]#");
  delay(5000);
}

void loop()     
 
{
  char buffer[5];  // long data type has 11 characters (including the minus sign) and a terminating null
  int nrOfBlinks;
  int lineNr;
 
       
      /*
       Your buffer must be large enough to hold the maximum number of characters in the string.
       For 16-bit base 10 (decimal) integers, that is seven characters (five digits, a possible minus sign, and a terminating 0 that always signifies the end of a string);
       32-bit long integers need 12 character buffers (10 digits, the minus sign, and the terminating 0).
       No warning is given if you exceed the buffer size; this is a bug that can cause all kinds of strange symptoms,
       because the overflow will corrupt some other part of memory that may be used by your program.
       The easiest way to handle this is to always use a 12-character buffer and always use ltoa because this will work on both 16-bit and 32-bit values.

      */
        Serial.println("#S|OPNMATLAB|[]#");
        delay(15000);
       
        for(lineNr=1;lineNr<=3;lineNr++) {
        clearSerialBuffer();
        Serial.print("#S|LEESWITHE|[");           //Leest de waarden binnen van matlab
        Serial.print(itoa((lineNr), buffer, 10)); //Converteert de integer naar een string en steekt het resultaat in een array
        Serial.println("]#");                     //Want er kunnen enkel string-waarden doorgegeven worden naar Gobetwino
        readSerialString (serInString, 10000);
        nrOfBlinks = atoi(serInString);    //Converteert een sting naar een integer
         
        delay(2000);
        Serial.print("#S|LOGTEST|[");
        //Serial.print(itoa((nrOfBlinks), buffer, 10));
        Serial.print(serInString);
        Serial.println("]#");
        delay(2000);
         
         //if (nrOfBlinks >= 50)
        //{
        //digitalWrite(ledGreen, HIGH);
        //digitalWrite(ledRed, LOW);     
        //}
       
        //else if (nrOfBlinks < 50)
        //{
        //digitalWrite(ledGreen, LOW);
        //digitalWrite(ledRed, HIGH); 
        //}
       }
       delay(15000);
}

void clearSerialBuffer(){
    char dummy;
    while (Serial.available()  {  //Also check for timeout here, also leave space for '\0' at the end of your C-String
      dummy = Serial.read();
      delay(10); //slight delay to allow the buffer to fill up
   }
}


void readSerialString (char *strArray,long timeOut) {
  // Wait up to timeOut miliseconds for data to arrive at the serial port, then read the data and put it in the char array strArray
   long startTime=millis();
   int i = 0;

   while (!Serial.available()) {
      if (millis()-startTime >= timeOut) {
         return;
      }
   }
    while (Serial.available() && i < (serInLen-1) && (millis()-startTime) < timeOut) {  //Also check for timeout here, also leave space for '\0' at the end of your C-String
      strArray[i] = Serial.read();
      i++;
      delay(10); //slight delay to allow the buffer to fill up
   }
   strArray[i]='\0';
   
}]int serInLen = 25;
int ledGreen = 8; // Groene led op pin 8
int ledRed = 4;  // Rode led op pin 4
char serInString[25];

void setup()                   
{
  pinMode(ledGreen, OUTPUT); 
  pinMode(ledRed, OUTPUT);
  Serial.begin(9600);
  Serial.println("#S|OPENCAMERA|[]#");
  delay(5000);
}

void loop()     
 
{
  char buffer[5];  // long data type has 11 characters (including the minus sign) and a terminating null
  int nrOfBlinks;
  int lineNr;
 
       
      /*
       Your buffer must be large enough to hold the maximum number of characters in the string.
       For 16-bit base 10 (decimal) integers, that is seven characters (five digits, a possible minus sign, and a terminating 0 that always signifies the end of a string);
       32-bit long integers need 12 character buffers (10 digits, the minus sign, and the terminating 0).
       No warning is given if you exceed the buffer size; this is a bug that can cause all kinds of strange symptoms,
       because the overflow will corrupt some other part of memory that may be used by your program.
       The easiest way to handle this is to always use a 12-character buffer and always use ltoa because this will work on both 16-bit and 32-bit values.

      */
        Serial.println("#S|OPNMATLAB|[]#");
        delay(15000);
       
        for(lineNr=1;lineNr<=3;lineNr++) {
        clearSerialBuffer();
        Serial.print("#S|LEESWITHE|[");           //Leest de waarden binnen van matlab
        Serial.print(itoa((lineNr), buffer, 10)); //Converteert de integer naar een string en steekt het resultaat in een array
        Serial.println("]#");                     //Want er kunnen enkel string-waarden doorgegeven worden naar Gobetwino
        readSerialString (serInString, 10000);
        nrOfBlinks = atoi(serInString);    //Converteert een sting naar een integer
         
        delay(2000);
        Serial.print("#S|LOGTEST|[");
        //Serial.print(itoa((nrOfBlinks), buffer, 10));
        Serial.print(serInString);
        Serial.println("]#");
        delay(2000);
         
         //if (nrOfBlinks >= 50)
        //{
        //digitalWrite(ledGreen, HIGH);
        //digitalWrite(ledRed, LOW);     
        //}
       
        //else if (nrOfBlinks < 50)
        //{
        //digitalWrite(ledGreen, LOW);
        //digitalWrite(ledRed, HIGH); 
        //}
       }
       delay(15000);
}

void clearSerialBuffer(){
    char dummy;
    while (Serial.available()  {  //Also check for timeout here, also leave space for '\0' at the end of your C-String
      dummy = Serial.read();
      delay(10); //slight delay to allow the buffer to fill up
   }
}


void readSerialString (char *strArray,long timeOut) {
  // Wait up to timeOut miliseconds for data to arrive at the serial port, then read the data and put it in the char array strArray
   long startTime=millis();
   int i = 0;

   while (!Serial.available()) {
      if (millis()-startTime >= timeOut) {
         return;
      }
   }
    while (Serial.available() && i < (serInLen-1) && (millis()-startTime) < timeOut) {  //Also check for timeout here, also leave space for '\0' at the end of your C-String
      strArray[i] = Serial.read();
      i++;
      delay(10); //slight delay to allow the buffer to fill up
   }
   strArray[i]='\0';
   
}
Pages: 1 [2] 3 4 ... 13