Show Posts
Pages: [1] 2 3
1  Using Arduino / Programming Questions / Re: Header file problem ? on: September 11, 2013, 06:17:47 am
Quote
If i dont add the #includes once I start creating objects in the below code I get:
Of course. But, the question is if you don't add them where? It seems to me that you want to use a header file in a source file that is NOT included in the sketch.

I don't know how often we need to repeat this. Using the IDE, you can't do that. Get over it.

If you mean something else, use nouns instead of pronouns!
I know obviously that the required headers must be in the same directory as the source files.However I use the #include keyword for the headers i was referring previously to in the main.cpp file and It compiles even if the required headers are not in the exact same directory as main.cpp.However once I create a new header file in the same directory as main.cpp and use the exact same #include commands it cant find the headers for some reason. 
2  Using Arduino / Programming Questions / Re: Header file problem ? on: September 07, 2013, 03:46:51 pm
Quote
The strange thing is in the source file that contains the void setup() and void loop() if I use the following it complies fine but in the header which contains the class I was referring to it wont.
Do you mean that it won't compile if you don't also include the header files in your sketch? If that's what you mean, that is by design. Only the sketch is scanned to determine what to copy to the build directory. Compilation takes place in that directory.
If i dont add the #includes once I start creating objects in the below code I get:

 error: 'RTC_DS1307' does not name a type
 error: 'dht' does not name a type
 error: 'Adafruit_BMP085' does not name a type

And if I do I get the "No such file or directory" error



Code:
#ifndef DATA_LOG_H
#define DATA_LOG_H

///////////////-<<<<<<<<<<<<<<<<<<<the following #include cause the errors
#include <Adafruit_BMP085.h>   
#include <dht.h>
#include <Wire.h>
#include "RTClib.h"
//#include <SD.h>
//#include "U8glib.h"



class Datalogger
{
 private:
RTC_DS1307 RTC;
dht DHT,DHT2;
//File myfile;
//DateTime now;
Adafruit_BMP085 bmp;
//Sd2Card card;
//SdVolume volume;
//SdFile root;

void startup();


public:
Datalogger();
void main_loop();
 
};


#endif

3  Using Arduino / Programming Questions / Header file problem ? on: September 07, 2013, 02:29:48 pm
Hi

Im using multiple library's in a project these include Wire,SD,RTClib,dht,BMP085,U8glib.


Now in my project I have a class that needs to work with the library objects however the compiler throws an error .

Code:
#ifndef DATA_LOG_H
#define DATA_LOG_H

///////////////-<<<<<<<<<<<<<<<<<<<the following #include cause the errors
#include <Adafruit_BMP085.h>   
#include <dht.h>
#include <Wire.h>
#include "RTClib.h"
#include <SD.h>
#include "U8glib.h"



class Datalogger
{
 private:
//RTC_DS1307 RTC;
//dht DHT,DHT2;
//File myfile;
//DateTime now;
//Adafruit_BMP085 bmp;
//Sd2Card card;
//SdVolume volume;
//SdFile root;

void startup();


public:
Datalogger();
void main_loop();
 
};


#endif


Im receiving the following error.
Code:
error Adafruit_BMP085.h: No such file or directory
error: dht.h: No such file or directory
error: Wire.h: No such file or directory
error: RTClib.h: No such file or directory
error: SD.h: No such file or directory
error: U8glib.h: No such file or directory


The strange thing is in the source file that contains the void setup() and void loop() if I use the following it complies fine but in the header which contains the class I was referring to it wont.
Code:
#include <Adafruit_BMP085.h>   
#include <dht.h>
#include <Wire.h>
#include "RTClib.h"
#include <SD.h>
#include "U8glib.h"
4  Using Arduino / Installation & Troubleshooting / 644p bootloader ? on: March 10, 2013, 12:52:36 pm
Im using the guide from
Code:
http://www.gammon.com.au/forum/?id=11635
to attempt to burn a different boot loader onto the 644p so it will work with the latest arduino Ide.Im using a atmega 328 as the programmer and the 644p as the slave.The error im getting is
Code:
Atmega chip programmer.
Written by Nick Gammon.
Entered programming mode OK.
Signature = 0x1E 0x96 0x0A
Processor = ATmega644P
Flash memory size = 65536 bytes.
LFuse = 0xFF
HFuse = 0xDC
EFuse = 0xFD
Lock byte = 0xCF
Clock calibration = 0x82
No bootloader support for this device.
Type 'C' when ready to continue with another chip ...


Ideas please ?
5  Using Arduino / Sensors / Dht22 arduino libary ? on: March 06, 2013, 10:22:10 am
Hi Im using the arduino DHTLib with multiple dht22 sensors however its a bit slow every time I take a read of the temperature and humidity which is every 2 sec.Is there a library available that wont cause as much of a delay when I read the data from the sensor?
6  Using Arduino / Installation & Troubleshooting / Re: Problem with atmega 644 on: March 03, 2013, 02:26:04 pm

Thanks.
7  Using Arduino / Installation & Troubleshooting / Re: Problem with atmega 644 on: March 03, 2013, 12:26:08 pm
Thanks anyway

Is it possible to burn a bootloader on a 644 by using a atmega 328 or does it need to be a programmer ?
8  Using Arduino / Installation & Troubleshooting / Re: Problem with atmega 644 on: March 03, 2013, 10:44:58 am
Im using this board.txt

Code:

##############################################################

mighty_opt.name=Mighty 644p 16MHz using Optiboot
mighty_opt.upload.protocol=arduino
mighty_opt.upload.maximum_size=63488
mighty_opt.upload.speed=115200
mighty_opt.bootloader.low_fuses=0xF7
mighty_opt.bootloader.high_fuses=0xde
mighty_opt.bootloader.extended_fuses=0xfd
mighty_opt.bootloader.path=optiboot
bobuino644.bootloader.file=optiboot_atmega644p-4-5.hex
mighty_opt.bootloader.unlock_bits=0x3F
mighty_opt.bootloader.lock_bits=0x0F
mighty_opt.build.mcu=atmega644
mighty_opt.build.f_cpu=16000000L
#mighty_opt.build.core=arduino:arduino
mighty_opt.build.core=standard
mighty_opt.build.variant=standard

Im not sure 100% which boot loader is on my 644 pretty sure its sanguino.
9  Using Arduino / Installation & Troubleshooting / Re: Problem with atmega 644 on: March 03, 2013, 09:58:25 am
@pito yes I can confirm it does upload on 0023 arudino IDE so circuitry is fine but not any other version like the latest 1.0.3 for some reason.Ive tried pulling rst to gnd quickly then back to vcc via 10k resistor just before I click the upload button and still get error "avrdude : stk500_getsync(): not in sync:resp=0x49" .
10  Using Arduino / Installation & Troubleshooting / Re: Problem with atmega 644 on: March 03, 2013, 05:38:54 am
Ok Ive made the changes and now im getting when I try and upload the following error "avrdude : stk500_getsync(): not in sync:resp=0x49".Tried mighty_opt.build.mcu=atmega644 and mighty_opt.build.mcu=atmega644p made no difference.
11  Using Arduino / Installation & Troubleshooting / Re: Problem with atmega 644 on: March 02, 2013, 06:46:37 am
Ok I downloaded ardunio 1.0.3 then I extracted everything in the mighty-1284p-master to ardunio-1.0.3/hardware/ .Then added the following to the boards.txt located in the ardunio-1.0.3/hardware/mighty-1284p-master.

Code:
##############################################################

mighty_opt.name=Mighty 1284p 16MHz using Optiboot >> Mighty 644p 16MHz using Optiboot
mighty_opt.upload.protocol=arduino
mighty_opt.upload.maximum_size=130048 >> 63488?? with 2K bootloader
mighty_opt.upload.speed=115200
mighty_opt.bootloader.low_fuses=0xff
mighty_opt.bootloader.high_fuses=0xde
mighty_opt.bootloader.extended_fuses=0xfd
mighty_opt.bootloader.path=optiboot
mighty_opt.bootloader.file=optiboot_atmega1284p.hex
mighty_opt.bootloader.unlock_bits=0x3F
mighty_opt.bootloader.lock_bits=0x0F
mighty_opt.build.mcu=atmega1284p >> atmega644p
mighty_opt.build.f_cpu=16000000L
#mighty_opt.build.core=arduino:arduino
mighty_opt.build.core=standard
mighty_opt.build.variant=standard


However when "Mighty 1284p 16MHz using Optiboot >> Mighty 644p 16MHz using Optiboot " is selected under boards and I try and upload a sketch I get the following error:

"unknown MCU 'atmega1284p >>atmega644p' specified (then a list of at mega's)



12  Using Arduino / Installation & Troubleshooting / Problem with atmega 644 on: March 01, 2013, 09:24:45 am
Hi i have some problems trying to upload a sketch to a atmega 644.When I use ardunio 0023 and select "sanguino" under board It will upload fine.However when I use Ardunio 1.0.1 with the updated sanguino core files especially for 1.0.1 I get the following error :

avrdude: Yikes! invalid device signature
          double check connections and try again or use-f to override


Some help please ?
13  Using Arduino / Project Guidance / Temperture/humidity sensor ? on: February 19, 2013, 06:18:37 am
Hi im looking for a temperature and humidity sensor in one or a separate sensor combination that can interface with a atmega via i2c,spi,analog and with some arduino library support if possible.It is to be used both outdoors and indoors and needs to be capable of the following:

Negative temperatures
Reasonable accurate (no more than 1°C-2°C out if possible)
Temperature resolution in centigrade of .1°C or .01°C (so i can get readings such as 24.98°C etc)
Humidity resolution of .1% would be nice(60.4% humidity etc)   



Which sensors do you recommend ?


Thx
14  Using Arduino / Microcontrollers / Re: Memory question ? on: December 14, 2012, 01:11:45 pm
T
The compiler discards it unless you actually use it in your program...?

That would explain it.
15  Using Arduino / Microcontrollers / Memory question ? on: December 14, 2012, 12:06:34 pm
I have a atmega 328 and have been trying to follow the guide to finding out how much ram is being used at any given time for debug purposes.However in the serial monitor im getting 1824 bytes with the char array declared and with it commented out which is very confusing.

Any ideas whats going on ?

Im using the libary from here and the example sketch from here:
http://playground.arduino.cc//Code/AvailableMemory

Code:
#include <MemoryFree.h>

// 14-bytes string
//char str[] = "Hello, world!";


void setup() {
    Serial.begin(115200);
}


void loop() {
    //Serial.println(str);

    Serial.print("freeMemory()=");
    Serial.println(freeMemory());

    delay(1000);
}



Cheers
Pages: [1] 2 3