Show Posts
Pages: [1] 2 3
1  Using Arduino / Programming Questions / trying to count space from serial input on: October 06, 2013, 02:12:49 pm
I was tying to count the number of spaces of an input from the serial monitor.
Ex: I type "I like airplanes"  then my Space variable would = 2

But I am getting weird numbers. Part of my code is below.

Code:
if (Serial.available())
  {
   ch = Serial.read();
   StringOut += ch;
  }
  if (ch == ' '){
   space += 1;
   Serial.print(space);
  }

Any help?
2  Using Arduino / Programming Questions / Re: Can you have some code stored in memory separate from main compiled program? on: October 06, 2013, 10:37:23 am
It really is more for fun. Been studying operating systems and trying to duplicate some of it on a small scale.
3  Using Arduino / Programming Questions / Can you have some code stored in memory separate from main compiled program? on: October 06, 2013, 10:11:34 am
The topic pretty much says it. For example, could I have code on a SD card that I load into memory and execute?  I understand this can't be C++ or C code. Isn't something like this how drivers work?

Any tips are appreciated.

-Mike
4  Using Arduino / Microcontrollers / Possibly fried Pro Mini? on: August 07, 2013, 06:27:56 pm
I think I fried my Pro Mini. I was trying to solder a wire to the analog 4 & 5 pins, which on the pro mini, are on the inside very near to the processor. Some solder got on one of the processors pins, I didn't catch this until after I tried to power it on. Nothing happened, no lights or anything turned on.

Would this fry it?

If so how, can I test?
5  Using Arduino / Networking, Protocols, and Devices / NRF24LO1+ rf modules not sending data/receiving ? on: July 09, 2013, 11:26:31 pm
With the getting started code from this library: http://maniacbug.wordpress.com/2011/11/02/getting-started-rf24/ I got them to work. So when I write my own code something is going wrong. I have a "scout unit" reading from a temp sensor and then sending to a "base unit." The sensor works and values are being stored in variables just fine. So something is going wrong in either the sending or the receiving of packets. Below is part of the code for each unit.

Scout unit:

Quote
     //Collect sensor data
       float temp;
       temp = bmp.readTemperature();
      
      // Send data to base unit

      
      radio.write( &temp, sizeof(float));
      printf("Sent response.\n\r");

      // Now, resume listening so we catch the next packets.
      radio.startListening();


Base Unit:
Quote

//Collect data from scouts
    // Wait here until we get a response, or timeout (250ms)
    unsigned long started_waiting_at = millis();
    bool timeout = false;
    while ( ! radio.available() && ! timeout )
      if (millis() - started_waiting_at > 200 )
        timeout = true;

    // Describe the results
    if ( timeout )
    {
      printf("Failed, response timed out.\n\r");
    }
    else
    {
      // Grab the response, compare, and send to debugging spew
      float pong_back1;
     radio.read( &pong_back, sizeof(float));

      // Spew it
     Serial.println(pong_back1);
      //printf("Got response %f, round-trip delay: %lu\n\r",pong_back,millis()-pong_back);
    }


Any help would be appreciated.
6  Using Arduino / Sensors / Re: ir detector for a specific frequency range on: July 03, 2013, 03:03:52 pm
Yep, that is exactly it. Thanks!
7  Using Arduino / Sensors / Re: ir detector for a specific frequency range on: July 02, 2013, 12:28:36 am
I want it to be sensitive enough to detect passive ir like that from a human. I don't want motion detectors, rather I want to measure that amount of ir. Does something like that require an amp? or would the signal be strong enough to record as is?
8  Using Arduino / Sensors / Re: ir detector for a specific frequency range on: June 30, 2013, 11:24:38 pm
I know what I have. I am just using the photo resistor on it.
9  Using Arduino / Sensors / ir detector for a specific frequency range on: June 30, 2013, 10:41:31 pm
I would like to control the sensitivity of my ir sensor. I just have a simple sensor that is read by the analog pin of an arduino. This one: https://www.sparkfun.com/products/246

How do I go about doing this? with a pull up resister? an amp?
10  Using Arduino / Audio / Re: How to increase sampling rate and audio quality on Arduino on: April 13, 2013, 07:34:50 pm
I just want to write the sample to a SD card so would DAC be necessary?
11  Using Arduino / Audio / How to increase sampling rate and audio quality on Arduino on: April 13, 2013, 06:35:07 pm
So I have been told that the ADC built into Arduinos are unable to sample at very high quality nor can the memory of an Arduino store a very large sample. If it is not apparent yet, I don't know much about audio sampling and so far I have found it more complicated than I thought.

What I am looking to accomplish is to record a 10 second or so recording at mp3 quality, maybe a bit lower. That's it.

Can someone point me in the right direction of how to accomplish this? Is there a ic chip I can buy? Do you use external DAC's and memory?

The hardware I have now is an Uno with a SD card and an electret microphone breakout board.

Thanks!
12  Using Arduino / Networking, Protocols, and Devices / [help] HTTP Error 400. The request has an invalid header name on: March 11, 2013, 12:43:34 am
The headers I am using look like below with the last print line being my "data." I am using the WiFlyHQ library. Not sure what I am doing wrong. Probably something stupid and obvious like always. Any help would be appreciated.

Code:
/* Send the request */
wifly.println("POST /API/testapi.ashx HTTP/1.1");
wifly.println("Host: mywebsite.com");
        wifly.println("Content-Length: 40");
        wifly.println("X-Target-URI: http://sharesay.us");
        wifly.println("Content-Type: application/x-www-form-urlencoded; charset=UTF-8");
        wifly.println("Connection: Keep-Alive");
        wifly.println("key=123456");
    } else {
        Serial.println("Failed to connect");
13  Using Arduino / Networking, Protocols, and Devices / Failing to connect to wifi network - WIFly on: March 03, 2013, 07:23:51 pm
These wifly's seem to be quite temperamental.

Anyway, I am trying to connect my wifly rn-xv module to my home wifi network. I am talking to it via Com 4 using Terra Term.

I type this :
<2.32> join <HOME-5482>

I get this:
Auto-Assoc <HOME-5482> chan=0 mode=NONE FAILED

I am certain my password I set is correct. What could be the causes for this?
14  Using Arduino / Networking, Protocols, and Devices / Trouble connecting via ad hoc on: February 28, 2013, 12:16:47 am
I am having the Wifly RN-XV module start up in ad hoc mode by having 3.3v to pin 8 as per the user manual. On power up I am getting the consecutive green, yellow, and red flashing. The wifly module shows up in my networks. I connect to it. This is where the problem comes in. Sometimes I am told that I cannot connect to the wifly. Sometimes I connect to it successfully, but then it disconnects shortly. I then just get a rapid red flashing light and a slow blinking green light. When trying to do telnet with Tera Term it says connection time out. I am thinking it is a hardware issue. Any thoughts?
15  Using Arduino / Networking, Protocols, and Devices / Re: Can't get Wifly RN-XV into command mode on: February 23, 2013, 01:22:41 am

Don't use SoftwareSerial with the RN-XV. It's quite picky about the serial timing and the SoftwareSerial cannot fulfill the needs of the RN-XV. I never got it running using SoftwareSerial but it runs like a charm on the hardware serial.


Ah I see.

Quote

You instantiate a SoftwareSerial instance but you're printing to the hardware serial interface and read from there.

From the hardware side mine is connected using an XBee shield (from Iteadstudio) that does the level conversion for the serial pins. Without that level conversion you may have destroyed the RN-XV already, the datasheet specifies "3V3 tolerant" whatever that may mean. In the electrical characteristics the voltage is specified with 3.7V max.

Ah, I see my mistake now. What voltage does the Uno digital write at? I thought it was around 3.3v?

And since I have not been writing to the digital pins this whole time my device appears to be fine.

And thank you!
Pages: [1] 2 3