Pages: 1 ... 22 23 [24] 25 26 ... 45   Go Down
Author Topic: Arduino on Xcode Project — Official Thread  (Read 132294 times)
0 Members and 1 Guest are viewing this topic.
France
Offline Offline
God Member
*****
Karma: 11
Posts: 637
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please find a new release of embedXcode.

embedXcode • Apr 28, 2013 release 47 • Pre-processing variable EMBEDXCODE

A project using embedXcode declares a pre-processing variable, EMBEDXCODE, with the release number as value.

Code:
EMBEDXCODE = 47

The variable and the value are passed on to the compiler as a -D variable:

Code:
-DEMBEDXCODE=47

This allows you to manage conditional #define and #include based on the IDE you use, either Xcode or one of the large Processing-based family.

The EMBEDXCODE variable is already used in the main.cpp code file so it is only considered when compiled by Xcode, and ignored by the Processing-based IDEs.


As always,
• Website: http://embedxcode.weebly.com
• Download: http://embedxcode.weebly.com/download
• User guide: http://embedxcode.weebly.com/tutorial

Enjoy smiley
Logged


New Jersey
Offline Offline
God Member
*****
Karma: 2
Posts: 517
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


panStamp is a whole new platform and is not currently supported by Arduino.

I'd need a couple of these boards so I can investigate and add support to them.

From the IDE perspective, it's the same as Arduino Pro or Pro Mini (3.3V, 8Mhz) w/ATmega 328.  This is the board I select in Arduino IDE when uploading to panstamp
Logged

New Jersey
Offline Offline
God Member
*****
Karma: 2
Posts: 517
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Please find a new release of embedXcode.

embedXcode • Apr 28, 2013 release 47 • Pre-processing variable EMBEDXCODE

A project using embedXcode declares a pre-processing variable, EMBEDXCODE, with the release number as value.

For projects I created with an earlier release of embedxcode, will this pre-processing variable still be set?  If not, how do I implement this feature on projects I've already created?
Logged

New Jersey
Offline Offline
God Member
*****
Karma: 2
Posts: 517
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In LocalLibrary.h I have a #include <> for a library in my sketchbook libraries folder, but I get an error that xcode can't find it.  If I remove the include from LocalLibrary.h and put it in the .ino file, it works fine.  I've spent two hours trying to figure out what I'm doing wrong - reading XCode 4 Unleashed, Google searches, but I can't figure it out.  I'll but it's something really simple.  Please help.
Logged

France
Offline Offline
God Member
*****
Karma: 11
Posts: 637
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In LocalLibrary.h I have a #include <> for a library in my sketchbook libraries folder, but I get an error that xcode can't find it.  If I remove the include from LocalLibrary.h and put it in the .ino file, it works fine.  I've spent two hours trying to figure out what I'm doing wrong - reading XCode 4 Unleashed, Google searches, but I can't figure it out.  I'll but it's something really simple.  Please help.

It is very hard to help you on a specific project and it is not the purpose of the thread.

Just mention #include <> in both the main sketch and in the library.
Logged


France
Offline Offline
God Member
*****
Karma: 11
Posts: 637
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please find a new release of embedXcode.

embedXcode • Apr 28, 2013 release 47 • Pre-processing variable EMBEDXCODE

A project using embedXcode declares a pre-processing variable, EMBEDXCODE, with the release number as value.

For projects I created with an earlier release of embedxcode, will this pre-processing variable still be set?  If not, how do I implement this feature on projects I've already created?

embedXcode is a template, not a framework.

So, yes, you need to update all the makefile and the main.cpp files with the new release.
Logged


France
Offline Offline
God Member
*****
Karma: 11
Posts: 637
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


panStamp is a whole new platform and is not currently supported by Arduino.

I'd need a couple of these boards so I can investigate and add support to them.

From the IDE perspective, it's the same as Arduino Pro or Pro Mini (3.3V, 8Mhz) w/ATmega 328.  This is the board I select in Arduino IDE when uploading to panstamp


As I've said before, even if the panStamp is considered as a Arduino Pro or Pro Mini (3.3V, 8Mhz) w/ATmega 328 by the Arduino IDE, because it uses some obscure AVR library, it is a new platform for embedXcode.
Logged


France
Offline Offline
God Member
*****
Karma: 11
Posts: 637
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, but I can't provide general support for Arduino.

I strongly recommend the book Arduino Cookbook — Recipes to Begin, Expand, and Enhance Your Projects by Michael Margolis I purchased thanks to contributions.

It reviews all the basics of Arduino, both hardware and software, and provide very interesting technical tips.

« Last Edit: April 29, 2013, 04:57:14 am by avenue33 » Logged


New Jersey
Offline Offline
God Member
*****
Karma: 2
Posts: 517
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It is very hard to help you on a specific project and it is not the purpose of the thread.

Just mention #include <> in both the main sketch and in the library.

I understand.  I didn't know if the LocalLibrary files embedxcode created had some special setting or something that would cause my problem.  I posted on stack overflow, so hopefully I can get it figured out.  I tried your suggestion about about putting #include in the main sketch and library, but that didn't work.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone, I've been recently using embedXcode for some Arduino related projects. as you all know that code sense is not an option u can get in the arduino IDE. thats why i was trying to use embedXcode as it gives you the freedom to get the code sense of Xcode along with the other functionalities in Arduino IDE.

Now the problem I'm having is even though the standard C++ codes are recognised by Xcode, it can't yet recognise the Arduino specific codes for example in void loop(){} void is highlighted but not loop. in the same way while typing pinMo.. it's not showing any suggestions. As it was mentioned in the embedXcode tutorial, after running the automatic project configuration the code sense should work. But I couldn't figure out any solution. Am I doing something wrong or is there any little tweak i'm missing.

Please help me solve the issue
Logged

France
Offline Offline
God Member
*****
Karma: 11
Posts: 637
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

zulkarnine

Have you tried closing and opening the project again and the procedure described on section 4.6 Re-Index the Keywords for Code-Sense?

Strange enough, code-sense, auto-completion and arguments list are displayed usually without problem in my laptop. Now, it isn't a 100% hit because code-sense implementation changes with every Xcode release and as Apple is more than secretive about the customisation of Xcode.
Logged


France
Offline Offline
God Member
*****
Karma: 11
Posts: 637
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You're having something like:

void loop()

  • void is in red because it is a standard C++ predicat
  • loop() is in black as it is defined here

Let's define then call test

void test() {}

void loop() {
    test();
}


  • The first test() remains in black as it is defined here.
  • But the second test is coloured in orange as it is a call to a known function

So everything's normal  smiley
« Last Edit: May 10, 2013, 12:39:50 pm by avenue33 » Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your response, I tried re-indexing the way it was mentioned in 4.6 even ater that they don't show any color or auto-complete. pinMode or OUTPUT or Serial.print() doesn't show any sigh of auto completion. smiley-sad

in the 2nd post the example what you mentioned is the part of standard C++ code sense, isn't it.
like

int  functionName(int an_example,int b_example){
       return a_example+b_example;

}

void main(){
      int a=10;
      int b=20;
      cout<<functionName(a,b);
}

in the above mentioned example we are declaring a function functionName and calling it again in the main function. so it works fine since it is standard C++ implementation. But when I try to write:

  pinMode(pinNum,HIGH);
  Serial.begin(960);
  analogWrite(13,HIGH);

they don't show colors and I dont even get code completion suggestions. But they should be actually like this:

  pinMode(pinNum,HIGH);
  Serial.begin(960);
  analogWrite(13,HIGH);

aren't they? Since they are declared in Arduino.h

what i mean is the functions declared in Arduino.h are not being recognised by Xcode while i'm editing in the .ino file. It might have something to do with the Xcode version. I'm using Xcode 4.6.2. Is there anything I'm missing maybe smiley-confuse
« Last Edit: May 10, 2013, 01:45:22 pm by zulkarnine » Logged

France
Offline Offline
God Member
*****
Karma: 11
Posts: 637
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try commenting the whole Core library for code-sense section except #include "Arduino.h".

Code:
// Core library for code-sense
//#if defined(WIRING) // Wiring specific
//#include "Wiring.h"
//#elif defined(MAPLE_IDE) // Maple specific
//#include "WProgram.h"   
//#elif defined(MPIDE) // chipKIT specific
//#include "WProgram.h"
//#elif defined(DIGISPARK) // Digispark specific
#include "Arduino.h"
//#elif defined(ENERGIA) // LaunchPad, FraunchPad and StellarPad specific
//#include "Energia.h"
//#elif defined(CORE_TEENSY) // Teensy specific
//#include "WProgram.h"
//#elif defined(ARDUINO) && (ARDUINO >= 100) // Arduino 1.0 and 1.5 specific
//#include "Arduino.h"
//#elif defined(ARDUINO) && (ARDUINO < 100) // Arduino 23 specific
//#include "WProgram.h"
//#else // error
//#error Platform not defined
//#endif
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot.

After commenting out the whole section except #include "Arduino.h"  as you mentioned it solved my problem. everything is perfect now. The code sense  has started working.

Keep up the good work. smiley smiley smiley
Logged

Pages: 1 ... 22 23 [24] 25 26 ... 45   Go Up
Jump to: