Show Posts
Pages: [1]
1  Topics / Education and Teaching / Possible new example... Node.JS and Arduino on: April 21, 2012, 11:22:43 am
I am working on a little project I am open sourcing that I think would make a good example. It is currently based on a simple LED example but uses a Node.JS extension to allow for remote access via web services. I did this with the idea in mind that I would eventually use a wifi chip instead of the computer, but might be good for some people the way it is....
https://github.com/jrgleason/NodeJSArduinoLEDController

P.S. I would be more than willing to make this an example with some guidance.
2  Development / Other Software Development / Re: Cannot Find WProgram.h (differant) on: September 06, 2011, 02:16:12 pm
Thanks I will try out removing it (and no worries about response time we are all busy)...

Quote
You should be able to put it in the same directory as your code.
Then use
#include "WProgram.h"

When you say "it" do you mean I can just copy the WProgram.h header file into the same directory? I am new to C so is the header file just an interface description and has no need for a class or object file?

Thanks

Jackie
3  Development / Other Software Development / Re: Cannot Find WProgram.h (differant) on: August 29, 2011, 09:04:34 am
Tried this... no dice still...

Code:
jackie@jackie-Latitude-E6410:~/Development/Code/Arduino/libraries/Morse$ gcc -I ../../hardware/arduino/cores/arduino/ -c ./Morse.c
In file included from ./Morse.c:1:0:
../../hardware/arduino/cores/arduino/WProgram.h:8:27: fatal error: avr/interrupt.h: No such file or directory
compilation terminated.
4  Development / Other Software Development / Re: Cannot Find WProgram.h (differant) on: August 29, 2011, 08:58:53 am
Finally found the WProgram.h file it is in...

./hardware/arduino/cores/arduino

Anyone have any helpful tips on how to include or install it?
5  Development / Other Software Development / Re: Cannot Find WProgram.h (differant) on: August 26, 2011, 10:18:19 am
So after I execute ant on the build directory, where does it get built to? Do I have to have the header file in my classpath like Java? Where would the header file be after I built the project?
6  Development / Other Software Development / Re: Cannot Find WProgram.h (differant) on: August 25, 2011, 03:53:56 pm
P.S. I don't see that header. Do I need to compile something differantly?


Code:
jackie@jackie-Latitude-E6410:~/Development/Code/Arduino/core$ ls
api.txt  build.xml  done.txt     make.sh  preproc     src
bin      core.jar   license.txt  methods  preproc.pl  todo.txt

Jackie
7  Development / Other Software Development / Re: Cannot Find WProgram.h (differant) on: August 25, 2011, 03:52:14 pm
Thanks I will try this... remember when it come to "should be included" that I am compiling this from source and not using apt-get or something similar. Again I am a little new to C do you know how to include a header file from another directory?
8  Development / Other Software Development / Re: Cannot Find WProgram.h (differant) on: August 24, 2011, 11:31:03 am
Changed to...
Code:
#include <WProgram.h>
#include "Morse.h"
Also tried
Code:
#include <WProgram.h>
#include <Morse.h>

Response

Code:
jackie@jackie-Latitude-E6410:~/Development/Code/Arduino/libraries/Morse$ gcc Morse.c
Morse.c:1:22: fatal error: WProgram.h: No such file or directory
compilation terminated.

Code:
jackie@jackie-Latitude-E6410:~/Development/Code/Arduino/libraries/Morse$ ls
Morse.c  Morse.h

I will go over the link in a bit, any other ideas in the meantime?
9  Development / Other Software Development / Cannot Find WProgram.h (differant) on: August 24, 2011, 09:54:59 am
Ok so here is the deal,

Environment:
Compiled from Git Repo
Ubuntu x64

Last night I was successful at doing the blinking light tutorial using the sketch window. Now I want to create a C Library to do the Morse example. I am trying to do this in C instead of C++ but which I don't think should be that tough, but I am no expert. So I create the following in ./libraries/Morse

Code:
/*
  Morse.h - Library for flashing Morse code.
  Created by David A. Mellis, November 2, 2007.
  Released into the public domain.
*/
#ifndef Morse_h
#define Morse_h

#include <WProgram.h>

class Morse
{
  public:
    Morse(int pin);
    void dot();
    void dash();
  private:
    int _pin;
};

#endif
Morse.H

Code:
#include "WProgram.h"
#include "Morse.h"

Morse::Morse(int pin)
{
  pinMode(pin, OUTPUT);
  _pin = pin;
}

void Morse::dot()
{
  digitalWrite(_pin, HIGH);
  delay(250);
  digitalWrite(_pin, LOW);
  delay(250); 
}

void Morse::dash()
{
  digitalWrite(_pin, HIGH);
  delay(1000);
  digitalWrite(_pin, LOW);
  delay(250);
}
Morse.c

Now comes the tricky part, first if I try to do what I want (which is compile using gcc Morse) I get the following...

Code:
jackie@jackie-Latitude-E6410:~/Development/Code/Arduino/libraries/Morse$ gcc Morse.c
Morse.c:1:22: fatal error: WProgram.h: No such file or directory
compilation terminated.

And if I use the sketch window I get the following...

Code:
     [exec]
     [exec]
     [exec]
     [exec]
     [exec]
     [exec]
     [exec]
     [exec]
     [exec]
     [exec]
     [exec] In file included from /home/jackie/Development/Code/Arduino/build/linux/work/libraries/Morse/Morse.c:2:
     [exec] /home/jackie/Development/Code/Arduino/build/linux/work/libraries/Morse/Morse.h:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Morse’
     [exec] /home/jackie/Development/Code/Arduino/build/linux/work/libraries/Morse/Morse.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
     [exec] /home/jackie/Development/Code/Arduino/build/linux/work/libraries/Morse/Morse.c:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
     [exec] /home/jackie/Development/Code/Arduino/build/linux/work/libraries/Morse/Morse.c:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token

Any ideas?

Thanks!
Pages: [1]