Show Posts
Pages: 1 ... 6 7 [8] 9 10 ... 13
106  Using Arduino / Programming Questions / Re: How to use Timer to exit LoopA,then run LoopB? on: November 27, 2012, 11:09:27 pm
EDIT: Wrong Answer tomorrow i post right one now i am late

Code:
void loop(){
while (millis() < 10000) {
LoopA();
}
while (millis() < 2000) {
LoopB();
}
}

Are you looking for this
107  Using Arduino / Programming Questions / Re: load a file in eeprom on: November 27, 2012, 08:00:27 am
Quote
but instead of counting basicly, i want to push a little file.txt into it..(size=300 bytes)

First Step
Reading a file from Sd Card
Code:
void readFile(char* file ,char *fileData)
{
  int16_t  readed;
  File myFile = SD.open(file,FILE_READ);

  if(myFile!=NULL){
    char* buf = (char*) malloc(myFile.size()+1);
    readed = myFile.read(buf,myFile.size());
    buf[readed]='\0';

    myFile.close();
    strcpy(fileData,buf);
    free(buf);
  }
  else
      strcpy(fileData,"Fail to open file");
}

Second step
call this funtion when you want to readfile for e.g file name test.txt

Code:
char fileData[300];
readFile("test.txt",fileData)

last step push data from fileData to EEPROM it's on you smiley-cool

One important point intialize the SD (Sd.begin(4)) in setup

108  Using Arduino / Programming Questions / Re: load a file in eeprom on: November 27, 2012, 04:38:44 am
Quote
i try to load a txt file in my wonderful 24c01 used in i2c way..
what do you suggest me to use for load it into it ? string sequence ? stream ?
i'd look on the library, but i did not see exemple of file's handles.

If your .txt file located in SdCard read the file in chunks(size of chunk must equal to size of EEPROM memory block)
http://fritzing.org/projects/readwrite-serial-eeprom-via-i2c/ for 24c01 interfacing
109  Using Arduino / Programming Questions / Re: Button Function on: November 27, 2012, 04:24:39 am
change the include file

Wprogram.h to  "Arduino.h" in button.h

cheers
110  Using Arduino / Programming Questions / Re: AS3 to Arduino - Passing Strings on: November 26, 2012, 10:34:15 pm
Quote
This solved the problem. Do you know of a way to trace or output the data from the AS3 socket that the Arduino is reading? I want to ensure that the string I am sending is being read correctly.

best Solution PaulS reply
Quote
You could write to an LCD, or to an SD card. The SD card isn't exactly real time, but it could work, with patience. Or use a Mega, Leonardo, or Micro with multiple serial ports, and an FTDI cable to connect the other serial port to the PC.

Quote
I want to ensure that the string I am sending is being read correctly.


For testing purpose you can even do it by blink a led if you know what your sending.
111  Using Arduino / Programming Questions / Re: Compiling Error - 'Unable to rename core.a - permission denied' on: November 26, 2012, 12:34:48 am
Quote
Hey guys,

I just received my Arduino Uno R3 a few minutes ago and I've written my first program (basic flashing LED). However, when I try to compile my code I get the following error:

D:\Documents\Arduino\Arduino 1.0.2\hardware\tools\avr\bin\avr-ar: unable to rename 'core.a'; reason: Permission denied

This also happens when I try compiling one of the example programs. I've tried editing the permissions in the folder containing avr-ar to no avail.

Does anyone know how to fix this?

Thanks,

Felix

Post more info
Are you running windows 7?
Is there any firewall on your system?

112  Using Arduino / Programming Questions / Re: Using a library in another library (Webduino) on: November 23, 2012, 08:12:56 am
Thankyou

i got your reply in a bus stand. After reading that now i am so happy while i am too late.

Ignore spelling and grammer because i am not good in using my moblie.

113  Using Arduino / Programming Questions / Re: Leonardo + MIDI + Interrupts on: November 23, 2012, 05:03:25 am
Quote
That's a fairly old post (Jan 2012) and refers to IDE 1.0 not 1.0.1 which is the one that supports the Leonardo.

Judging by the schematic the Tx and Rx LEDs are on pins PD5 and PB0 so I suppose whether they turn on or not is under software control.

Yes, Nick right

The RX and TX LEDs on the board will flash when data is being transmitted via the USB connection to the computer (but not for serial communication on pins 0 and 1).
114  Using Arduino / Programming Questions / Re: Leonardo + MIDI + Interrupts on: November 23, 2012, 04:57:50 am
Quote
And what are the RX/TX leds representing now? Communication on Serial or Serial1?

EDIT:Follow nick reply
115  Using Arduino / Programming Questions / Re: arduino > xbee > xbee > components on: November 23, 2012, 02:10:04 am
By entering in google "using xbee without microcontroller" all results shows your answer smiley-cool

try this respectively

http://answers.oreilly.com/topic/2467-how-to-use-direct-input-and-output-on-an-xbee-radio/
http://www.kobakant.at/DIY/?tag=xbee
http://cytron.com.my/attachment/Details%20Description/PR20_DD.pdf
116  Using Arduino / Programming Questions / Re: Leonardo + MIDI + Interrupts on: November 23, 2012, 01:49:01 am
Read this http://arduino.cc/en/Main/ArduinoBoardLeonardo


Quote
Could it be related to the new methods of dealing with serial communication? I don't see the TX/RX diodes blinking for example
I hope so this is your problem

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data using the ATmega32U4 hardware serial capability. Note that on the Leonardo, the Serial class refers to USB (CDC) communication; for TTL serial on pins 0 and 1, use the Serial1 class.
117  Using Arduino / Programming Questions / Re: Error of multiple defination(by using a library in another library) on: November 23, 2012, 01:34:57 am
Quote
Hello, in your sketch, remove all includes but this one:
Code:
Code:
#include "WebServer.h"
Should work...or not

Did not work because library header file "WebPages.h"


Quote
Edit: Sorry I've misread, not sure what your problem might be :/

Try removing #include "WebServer.h" from your sketch.

EDIT: By doing this Same Errors there Sorry last time i mention wrong error
118  Using Arduino / Programming Questions / (SOLVED)Error of multiple defination(by using a library in another library) on: November 23, 2012, 01:10:36 am
After reading this thread http://arduino.cc/forum/index.php/topic,120624.0.html i try this but Error of multiple defination start occuring what is the reason behind it?
I really appreciate your suggestions.

Sketch
Code:
#include "WebPages.h"
#include <SPI.h>
#include <Ethernet.h>
#include "WebServer.h"

WebPages Pages;

void setup()
{
  Pages.setup();
}

void loop()
{
  Pages.servProcess();
}



WebPages.h
Code:
#ifndef WebPages_h
#define WebPages_h

#include "WebServer.h"
#include "Arduino.h"
#include <SPI.h>
#include <Ethernet.h>


class WebPages
{
  public:
    WebPages();
void setup();
void servProcess();
 private:
static void defaultCmd(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete);
};

//extern WebPages Pages;
#endif


WebPages.cpp
Code:
#include "WebPages.h"

#include <SPI.h>
#include <Ethernet.h>
#include "Arduino.h"

template<class T>
inline Print &operator <<(Print &obj, T arg)
{ obj.print(arg); return obj; }


static uint8_t mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
static uint8_t ip[] = { 192, 168, 1, 210 };
#define PREFIX ""
WebServer webserver(PREFIX, 80);

WebPages::WebPages()
{
//created
}
void WebPages::defaultCmd(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete)
{
  P(htmlHead) =
    "<html>"
    "<head>"
    "<title>Arduino Web Server</title>"
    "<style type=\"text/css\">"
    "BODY { font-family: sans-serif }"
    "H1 { font-size: 14pt; text-decoration: underline }"
    "P  { font-size: 10pt; }"
    "</style>"
    "</head>"
    "<body>"
"TEST"
"</body>";
  server.httpSuccess();
  server.printP(htmlHead);
}
void WebPages::setup()
{
Ethernet.begin(mac, ip);
webserver.begin();
webserver.setDefaultCommand(&WebPages::defaultCmd);
}

void WebPages::servProcess()
{
webserver.processConnection();
}

//WebPages Pages = WebPages();


WebServer.h file of webduino


ERRORS
Quote
WebPages\WebPages.cpp.o: In function `WebServer::setDefaultCommand(void (*)(WebServer&, WebServer::ConnectionType, char*, bool))':
/WebServer.h:356: multiple definition of `WebServer::setDefaultCommand(void (*)(WebServer&, WebServer::ConnectionType, char*, bool))'
Webpages.cpp.o:D:\arduino-1\libraries\WebPages/WebServer.h:356: first defined here
WebPages\WebPages.cpp.o: In function `WebServer::setFailureCommand(void (*)(WebServer&, WebServer::ConnectionType, char*, bool))':
/WebServer.h:361: multiple definition of `WebServer::setFailureCommand(void (*)(WebServer&, WebServer::ConnectionType, char*, bool))'
Webpages.cpp.o:D:\arduino-1\libraries\WebPages/WebServer.h:361: first defined here
WebPages\WebPages.cpp.o: In function `WebServer::addCommand(char const*, void (*)(WebServer&, WebServer::ConnectionType, char*, bool))':
/WebServer.h:364: multiple definition of `WebServer::addCommand(char const*, void (*)(WebServer&, WebServer::ConnectionType, char*, bool))'
Webpages.cpp.o:D:\arduino-1\libraries\WebPages/WebServer.h:364: first defined here
WebPages\WebPages.cpp.o: In function `WebServer::push(int)':

Other in txt attach file
119  Using Arduino / Programming Questions / Re: Using a library in another library (Webduino) on: November 23, 2012, 12:58:02 am
After reading this thread i try this but Error of multiple defination start occuring why?

I really appreciate your suggestions.

Sketch
Code:
#include "WebPages.h"
#include <SPI.h>
#include <Ethernet.h>
#include "WebServer.h"

WebPages Pages;

void setup()
{
  Pages.setup();
}

void loop()
{
  Pages.servProcess();
}



WebPages.h
Code:
#ifndef WebPages_h
#define WebPages_h

#include "WebServer.h"
#include "Arduino.h"
#include <SPI.h>
#include <Ethernet.h>


class WebPages
{
  public:
    WebPages();
void setup();
void servProcess();
 private:
static void defaultCmd(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete);
};

//extern WebPages Pages;
#endif


WebPages.cpp
Code:
#include "WebPages.h"

#include <SPI.h>
#include <Ethernet.h>
#include "Arduino.h"

template<class T>
inline Print &operator <<(Print &obj, T arg)
{ obj.print(arg); return obj; }


static uint8_t mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
static uint8_t ip[] = { 192, 168, 1, 210 };
#define PREFIX ""
WebServer webserver(PREFIX, 80);

WebPages::WebPages()
{
//created
}
void WebPages::defaultCmd(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete)
{
  P(htmlHead) =
    "<html>"
    "<head>"
    "<title>Arduino Web Server</title>"
    "<style type=\"text/css\">"
    "BODY { font-family: sans-serif }"
    "H1 { font-size: 14pt; text-decoration: underline }"
    "P  { font-size: 10pt; }"
    "</style>"
    "</head>"
    "<body>"
"TEST"
"</body>";
  server.httpSuccess();
  server.printP(htmlHead);
}
void WebPages::setup()
{
Ethernet.begin(mac, ip);
webserver.begin();
webserver.setDefaultCommand(&WebPages::defaultCmd);
}

void WebPages::servProcess()
{
webserver.processConnection();
}

//WebPages Pages = WebPages();


WebServer.h file of webduino


ERRORS
Quote
WebPages\WebPages.cpp.o: In function `WebServer::setDefaultCommand(void (*)(WebServer&, WebServer::ConnectionType, char*, bool))':
/WebServer.h:356: multiple definition of `WebServer::setDefaultCommand(void (*)(WebServer&, WebServer::ConnectionType, char*, bool))'
Webpages.cpp.o:D:\arduino-1\libraries\WebPages/WebServer.h:356: first defined here
WebPages\WebPages.cpp.o: In function `WebServer::setFailureCommand(void (*)(WebServer&, WebServer::ConnectionType, char*, bool))':
/WebServer.h:361: multiple definition of `WebServer::setFailureCommand(void (*)(WebServer&, WebServer::ConnectionType, char*, bool))'
Webpages.cpp.o:D:\arduino-1\libraries\WebPages/WebServer.h:361: first defined here
WebPages\WebPages.cpp.o: In function `WebServer::addCommand(char const*, void (*)(WebServer&, WebServer::ConnectionType, char*, bool))':
/WebServer.h:364: multiple definition of `WebServer::addCommand(char const*, void (*)(WebServer&, WebServer::ConnectionType, char*, bool))'
Webpages.cpp.o:D:\arduino-1\libraries\WebPages/WebServer.h:364: first defined here
WebPages\WebPages.cpp.o: In function `WebServer::push(int)':

Other in txt attach file
120  Using Arduino / Programming Questions / Re: Thermistor4 compile issues on: November 22, 2012, 02:34:32 am
you didnot Incude "Arduino.h" in your header file.

In some IDE it's WProgram.h may be because i have 1.0.1 IDE "Arduino.h" works
Pages: 1 ... 6 7 [8] 9 10 ... 13