Go Down

Topic: Arduino on Xcode Project — Official Thread (Read 400220 times) previous topic - next topic


avenue33

Please find a new major release of embedXcode.

  • embedXcode  • 25 Sep 2018 release 10.0.6 • Added IDE path to board configuration files
  • embedXcode+ • 25 Sep 2018 release 10.0.6 • Added IDE path to board configuration files
embedXcode now supports Xcode 10 on macOS 10.14 Mojave.

Download

avenue33

Release 10.2.3 updates support for Xcode 10.1 and macOS 10.14.1.

Download

xWingman

How do I get the serial terminal to output a CR LF on return when entering from the keyboard.

avenue33

You have different options:
  • set parameters for the `screen`utility,
  • use another serial console utility


Please refer to Manage the serial console after upload for more information.

homechicken

I just downloaded embedxcode, and I am having trouble getting it to work. I have the Arduino 1.8.9 release with all the board files updated to the latest available version. I start a new embedxcode project in Xcode, don't even add any code, and I can compile it, but if I try to upload it I get "avrdude: ser_open(): can't open device "/dev/tty.usbmodem14201": No such file or directory".  This is the port that is configured for my Leonardo in the Arduino IDE, and compiling and uploading sketches from there works fine. Any ideas on how to fix this issue?

I'm using Mac 10.14.5, Xcode 10.2.1.

avenue33

#831
Aug 15, 2019, 12:59 pm Last Edit: Aug 15, 2019, 01:05 pm by avenue33
Please open a ticket at the Help Desk with What information to provide when asking for help. Thank you!

If the issue is about the Arduino Leonardo board, version 10.9.8 released 08 Jul 2019 improved stability for the Arduino Leonardo board.

sslupsky

Hello,

Are there any plans to incorporate the Arduino CLI into embedXcode so the IDE is not required?

Thank you,

avenue33

Release 11.2.1 of embedXcode adds support for Xcode 11.1 on macOS 10.15 Catalina.

It also brings support for latest Arduino Nano boards.

Download

avenue33

Hello,

Are there any plans to incorporate the Arduino CLI into embedXcode so the IDE is not required?

Thank you,
Actually, embedXcode doesn't require any component of the Arduino IDE except for managing and updating the boards packages. embedXcode relies on its own build manager for speed and customisation.

sslupsky

I've been using Visual Studio Code for a while now with Arduino and have become somewhat familiar with that workflow and quite prefer it to using the Arduino IDE. 

I am not sure if you are familiar with vs code but I thought to ask you if you can comment on how the embedXCode environment compares to vs code?  I am a macOS guy so I think I might like the embedXCode environment better because my general experience is UI issues are thought out much better in macOS.  However, I do not have any actual experience using Xcode so wondering if there are limitations using Xcode compared to vs code for Arduino.

FWIW, I use the following extensions with vs code:

Arduino
Bookmarks
C/C++
Debugger for Chrome
Docker
Doxygen documentation
Git Graph
GitLens
npm
Python
SPICE

avenue33

#836
Nov 02, 2019, 01:42 pm Last Edit: Nov 02, 2019, 01:51 pm by avenue33
Thank you for your interest in embedXcode. I tested Visual Studio Code with the dedicated Arduino extension  but wasn't happy with the splash screens.

The first main difference relies on the underlying IDE: Xcode versus Visual Studio Code. So it is more about which IDE are you more familiar with. Xcode is a very polished IDE with code-sense, check-as-you-type, and the features listed at A Glimpse of Xcode.

The second main difference is that embedXcode uses GNU make as build manager and not the Arduino Builder (with the splash screens).

The best way is to see by yourself and give a try with the embedXcode standard edition.

sslupsky

Yeah, the Arduino plugin for vscode is pretty weird.  Moreover, it doesn't work well with IntelliSense so the code checking can be problematic.  I've pretty much figured out what you need to do to get IntelliSense to work properly.  Unfortunately, someone responsible for the plugin broke it a few months ago by adding a "feature" that "auto" includes some recursive include paths.  Unfortunately, you cannot turn this "feature" off so it is a headache because if often uses the wrong header.  Thus, my interest in using Xcode instead.

Does Xcode support linting using the a third party gnu compiler?  I could not find a setting anywhere that let me specify the compiler.  This is one of the things you need to do with vscode to set it up properly.  I've got my linting set up to point to the same gcc compiler that Arduino uses.

Recently, I started using the arduino-cli and vscode "tasks" to do the build instead of using the plugin.

I recall I downloaded the standard edition a while ago.  I'll give it a go and see what happens.  Thanks for the feedback.

Eebel

Hi,

I just installed embedXCode and have it successfully uploading my Star Wars Astromech control program to an Arduino Mega 2560.  I have several libraries to run servos and LEDs in real time.  The code sense works fine for all of these libraries.  However, I cannot get the basic Arduino commands to use code sense (such as Serial.println("Gripper Arm DeActivated");)

Additionally, it doesn't seem to recognize procedures if they are defined after the procedure that calls them.  I was able to reorder the code to get the sketch to compile.  However, this isn't normal behavior.   I should be able to declare a function at the end of the file that gets called from the main loop without getting a build error.


For example, using the Arduino IDE this code works and compiles just fine.  But in embedXCode I get a "swapPS3NavControllers was not declared in this scope" error.


void onInitPS3(){
    Serial.print(F("\r\nGot to onInitPS3"));
    String btAddress = getLastConnectedBtMAC();
    PS3Nav->setLedOn(LED1);
    isPS3NavigatonInitialized = true;
    badPS3Data = 0;
    //sfx.playTrack("T12     OGG");
    trigger.trigger(23);
    #ifdef SHADOW_DEBUG
      output += "\r\nBT Address of Last connected Device when Primary PS3 Connected: ";
      output += btAddress;
      if (btAddress == PS3MoveNavigatonPrimaryMAC){
          output += "\r\nWe have our primary controller connected.\r\n";

      }else{
          output += "\r\nWe have a controller connected, but it is not designated as \"primary\".\r\n";
      }
    #endif
}




void onInitPS3Nav2(){
    String btAddress = getLastConnectedBtMAC();
    PS3Nav2->setLedOn(LED1);
    isSecondaryPS3NavigatonInitialized = true;
    badPS3Data = 0;
    //sfx.playTrack("T12     OGG");
   
    //TODO:Fix the error when uncommenting line below
    if (btAddress == PS3MoveNavigatonPrimaryMAC) swapPS3NavControllers();///<-------Error on this line !!
    #ifdef SHADOW_DEBUG
      output += "\r\nBT Address of Last connected Device when Secondary PS3 Connected: ";
      output += btAddress;
      if (btAddress == PS3MoveNavigatonPrimaryMAC){
          output += "\r\nWe have our primary controller connecting out of order.  Swapping locations\r\n";
      }else{
          output += "\r\nWe have a secondary controller connected.\r\n";
      }
    #endif
}

void swapPS3NavControllers(){
    PS3BT* temp = PS3Nav;
    PS3Nav = PS3Nav2;
    PS3Nav2 = temp;
    //Correct the status for Initialization
    boolean tempStatus = isPS3NavigatonInitialized;
    isPS3NavigatonInitialized = isSecondaryPS3NavigatonInitialized;
    isSecondaryPS3NavigatonInitialized = tempStatus;
    //Must relink the correct onInit calls
    PS3Nav->attachOnInit(onInitPS3);
    PS3Nav2->attachOnInit(onInitPS3Nav2);
}


I have gone through all of the help files from the embedXCode website about reindexing and manual setup and updating the makefile.  I don't know if it matters, but all of the example screen shots show the Arduino icon on the project .ino file while my .ino file has a C++ icon.

Any help would be greatly appreciated. I have spent five days mucking around with this and can't seem to make it work as expected.

sslupsky

You need to forward declare the function to clear up the error.

For instance, at the top of the file include the following forward declaration (prototype):

void swapPS3NavControllers(void);


Go Up