Show Posts
Pages: 1 ... 379 380 [381] 382 383 ... 581
5701  Using Arduino / Microcontrollers / Re: How to program using ICSP Headers? on: March 22, 2012, 10:35:40 pm
The ICSP header on the Duemilanove won't be much help in programming an ATmega on a perfboard.  The ICSP header is how you connect an ISP device for writing the bootloader the the Duemeianove.

Does your perfboard have an ICSP header?

Do you have an ISP device like the USBTinyISP or USBasp?
5702  Using Arduino / Programming Questions / Re: Declaring class objects within a class on: March 22, 2012, 04:13:35 pm
What does you failed code look like and what error do you get?
5703  Using Arduino / Sensors / Re: DHT22 not working with 8mhz clockspeed? on: March 22, 2012, 12:24:36 pm
> I'm kinda confused with the fact that the mcu doesn't know that at 8mhz, one time unit will be twice the amount as 16mhz...

The mcu doesn't know how fast it's running.   It thinks in instruction cycles.  Regardless of the clock rate each instruction takes the same number of instruction cycles so to the mcu it's all the same.

The Arduino core uses the F_CPU value set in boards.txt to measure time based on instruction cycles.

> I'm going to go home and change the count > 6 to count > 3 for giggles and see what happens.

Remember that "delayMicroseconds(1)" automatically adjusts when you switch from a 16 MHz Arduino to an 8 MHz one.  It's all the other instructions that will take twice as long.  Try values from 5 to 2 to see which ones give the desired results.  If more than one value gives the desired results, pick one in the middle.
5704  Using Arduino / Sensors / Re: How to read register value from ADXL345 Eval board? on: March 22, 2012, 12:16:21 pm
Make sure you don't have an SD card in the SD card slot.  The SD card slot uses the hardware SPI pins (10-13) so if you put a card in the slot you can't use Pin 10 for anything else.

If you want to use the sketch from http://www.sparkfun.com/tutorials/240 you will have to re-wire the evaluation board to connect the ADXL345 to pins 10-13 instead of pins 14-17 (A0-A3).  You should not need to make any change to the sketch supplied with that tutorial.
5705  Using Arduino / Sensors / Re: cmps10 ( Tilt Compensated Magnetic Compass) on: March 22, 2012, 12:02:36 pm
Are you implying that you want someone to write the sketch for you?  Perhaps you should offer money.
5706  Using Arduino / Microcontrollers / Re: ATTINY85 Can't upload sketch on: March 22, 2012, 09:50:43 am
My connections are perfect 8 pins :/..

The ISP connector should be 6 pins or 10 pins.  How is you ATtiny connected to the ISP header?  Did you 'burn the bootloader' first?  As I understand it that doesn't actually burn a bootloader but it DOES set the fuses correctly.
5707  Using Arduino / Sensors / Re: Testing DHT11 on arduino lily pad on: March 22, 2012, 09:45:48 am
Someone ELSE just noticed that the DHT11 library from adafruit didn't work on their home-built Arduino if they changed it to run at 8MHz (like the lillypad).  I looked at the library code and it looks like they use timing loops to measure pulse widths and compare the widths to a magic constant of 6 to determine if the pulse is a 1 or a 0.  I think that value has to be adjusted downward for an 8 MHz processor because the timing loops will be running slower.
5708  Using Arduino / Sensors / Re: cmps10 ( Tilt Compensated Magnetic Compass) on: March 22, 2012, 09:40:23 am
http://www.robot-electronics.co.uk/htm/cmps10doc.htm

http://www.robot-electronics.co.uk/htm/arduino_examples.htm#Tilt%20Compensated%20Magnetic%20Compass
5709  Using Arduino / Project Guidance / Re: IR remote on: March 22, 2012, 09:37:11 am
http://www.arcfn.com/2010/01/using-arbitrary-remotes-with-arduino.html
5710  Using Arduino / Sensors / Re: DHT22 not working with 8mhz clockspeed? on: March 22, 2012, 09:33:19 am
Did you select the 8 MHz homebrewino board and upload the sketch again?  If you select a 16 MHz board and upload to an 8 MHz board it will run at half speed.  The calls to "delay()" and "delayMicroseconds()" will be slow and that might be enough to screw up the receive timing. 

The code (https://github.com/adafruit/DHT-sensor-library/blob/master/DHT.cpp) measures pulse widths and looks for a count > 6.  Perhaps that value will have to be adjusted down because the code outside the "delayMicroseconds(1)" is running slower.
5711  Using Arduino / Sensors / Re: How to read register value from ADXL345 Eval board? on: March 22, 2012, 09:16:05 am
Show your sketch and I'll see if I can figure out what is wrong.
5712  Using Arduino / Networking, Protocols, and Devices / Re: Trouble with Parallex GPS and Arduino Mega2560 on: March 22, 2012, 09:12:28 am
still comes up with a repeated "y" in the serial monitor.

GPS.read() will return -1 if no characters are available to read.  When that it sent to Serial Monitor it is displayed as character 255 (ΓΏ).

Code:
int value = GPS.read();
if (value != -1)
    Serial.write((char)value);
5713  Using Arduino / Programming Questions / Re: Real Time Clock Chip for Waking up from Sleep on: March 22, 2012, 09:05:32 am
Does the alarm output mean to be 5 V rising edge of falling edge and how much power does this chip consume.

Read the data sheets.  The INT0 input needs a level change to wake the chip from sleep.
The chip uses a maximum of 25.6 (2V) or 86 (5V) microamps when keeping time.  If keeping time with the battery it uses 0.4 microamps.  I guess that means you can use an output pin to provide power to the chip when awake, then go back to battery power when the ATmega powers down.

I am also looking to switch the current to another device using relay functionality. And the relay would be turned on once the microcontroller comes back to sleep. I have checked out the basic circuits one given in the arduion play ground. I am unable to guess where would I place the positive and ground connection of the device which i need to run from the relay.

Driving a relay takes a good deal of power.  Are you saying you want the relay to stay activated even after the ATmega goes back to sleep?  I would think you'd want to use a latching relay for that so you don't use power just to keep some contacts closed.
5714  Using Arduino / Programming Questions / Re: Real Time Clock Chip for Waking up from Sleep on: March 22, 2012, 08:52:12 am
And if you use a 8 MHz crystal rather than 16 MHz then the 8 seconds becomes 16 seconds - and, it uses less power.
It will use less power but the Watchdog Timer uses a separate 128 kHz Watchdog Oscillator so the intervals won't change.
5715  Using Arduino / Storage / Re: Creating numbered files on an SD card on: March 21, 2012, 10:02:56 pm
From the adafruit logger shield demo:
Code:
// create a new file
  char filename[] = "LOGGER00.CSV";
  for (uint8_t i = 0; i < 100; i++) {
    filename[6] = i/10 + '0';
    filename[7] = i%10 + '0';
    if (! SD.exists(filename)) {
      // only open a new file if it doesn't exist
      logfile = SD.open(filename, FILE_WRITE);
      break;  // leave the loop!
    }
  }
  
  if (! logfile) {
    error("couldnt create file");
  }
Pages: 1 ... 379 380 [381] 382 383 ... 581