Go Down

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

KasparN

Hello,

I have a big Problem with X-Code and Arduino Uno:
if i try to send Datas to the serialport "/dev/tty*" it does NOT work, if i use the Serialport "/dev/cu*" it works...
More Details i wrote here :

http://forum.arduino.cc/index.php?topic=207287

Please can anyone here help me? im freaking out :-(

Thank you!

Kaspar

avenue33



avenue33


Fratink

Hello,

I'm trying to use embedXcode for developing a project, but I can't seem to get anything to work.  I've tried using Arduino 1.5.5, 1.0.5 and I have two computers, one runing xcode 4 and another with xcode 5.  I've installed the correct versions of embedXcode, but I always end up with script errors such as these:

~/Documents/Arduino/libraries/VirtualWire/VirtualWire.cpp:14:22: WProgram.h: No such file or directory
~/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:59: Variable or field 'vw_set_tx_pin' declared void

I'd really like to use embedXcode, but I just can't get it to work.  Is there something simple that I'm missing?

My systems are:
Macbook Pro 15-inch, Mid 2009, 2.8 GHz Intel Core 2 Duo running 10.9.1
Mac Pro, 2006, 2.6GHz Xeon, Running 10.7.5

Thanks for the help!

avenue33

Code: [Select]
#include "WProgram.h" is no longer valid: it was the old Arduino 0023 IDE.

If you're using the Arduino 1.0 or 1.5 IDE, you need to specify
Code: [Select]
#include "Arduino.h"

Please delete that old library and take a more recent one.

Fratink

avenue33,

Thanks for the quick reply.  I'm running the default sketch you get when you create e new project.  I believe it has those includes within the #ifdef statements.  Just to be sure I added #include "Arduino.h", but there was no change.

I've also attempted to compile for the Mega and the Uno  (by making new projects) but no change

Also, when the dialog box saying that embedxcode is donationware, it get a bunch of what looks like html code within the box.  This happens on both computers.

Cheers,

avenue33

Please refer to this post: http://forum.arduino.cc/index.php?topic=49956.msg1456956#msg1456956

Fratink

avenue33, that worked perfectly!  Thank you!

Fratink

Hello Again,

I'm having a strange problem.  I'm attempting to test the SD card writing compatibility of embedXcode.  So far if i compile the sketch and upload it It will only log 5 numbers.  If I compile the same sketch in the Arduino IDE it will work fine.  I'm not certain if it's a problem with my code, my installation, or embedXcode.

Code: [Select]

/*
SD card datalogger

This example shows how to log data from three analog sensors
to an SD card using the SD library.

The circuit:
* analog sensors on analog ins 0, 1, and 2
* SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4

created  24 Nov 2010
modified 9 Apr 2012
by Tom Igoe

This example code is in the public domain.

*/
#include <Arduino.h>
#include <SD.h>

// On the Ethernet Shield, CS is pin 4. Note that even if it's not
// used as the CS pin, the hardware CS pin (10 on most Arduino boards,
// 53 on the Mega) must be left as an output or the SD library
// functions will not work.
const int chipSelect = 4;

void setup()
{
    // make sure that the default chip select pin is set to
    // output, even if you don't use it:
    pinMode(10, OUTPUT);
pinMode(53, OUTPUT);
   
    // see if the card is present and can be initialized:
    SD.begin(chipSelect);
}

void loop()
{
digitalWrite(13, LOW);
    // make a string for assembling the data to log:
    String dataString = "";
   
    // read three sensors and append to the string:
    for (int analogPin = 0; analogPin < 3; analogPin++) {
        int sensor = analogRead(analogPin);
        dataString += String(sensor);
        if (analogPin < 2) {
            dataString += ",";
        }
    }
   
    // open the file. note that only one file can be open at a time,
    // so you have to close this one before opening another.
    File dataFile = SD.open("datalog_xcode.txt", FILE_WRITE);
   
    // if the file is available, write to it:
    if (dataFile) {
        dataFile.println(dataString);
        dataFile.close();
        // print to the serial port too:
    }
digitalWrite(13, HIGH);

}


Note:  I removed the serial terminal output to see if that was causing the problems (and because I don't need it).  It didn't change anything.

Thanks!

avenue33

I don't know what could happen.

Does the [font=Courier]SD.h[/font] include a [font=Courier]#include "Arduino.h"[/font] statement?

Fratink

#551
Jan 04, 2014, 05:25 am Last Edit: Jan 04, 2014, 05:57 am by Fratink Reason: 1
Hello avenue33,

I thought it a long shot, this is a rather tough problem to try and troubleshoot without seeing the actual installation and devices.  Seeing as how the code compiles I'm wondering if it's a build issue with the compiler.  I'll try it on a couple different boards I've got lying around and see if I can come up with anything more specific.  I'll post if I figure out anything.

EDIT:
Turns out it doesn't necessarily have anything to do with embedXcode.  If you make the string variable used in the data logging example a global variable (as opposed to local) the sketch runs, although not exactly the same.  Not sure of the cause here, might have to do with compiler settings?

Please See: http://forum.arduino.cc/index.php?topic=105631.0
End EDIT

Thanks again,

Fratink

avenue33

Thank you for the update! Glad to know it works now.

avenue33

Please find a new release of embedXcode.
  • embedXcode  • Jan 04, 2014 release 122 • Support for Energia 11 IDE, BLuno and Microduino boards
  • embedXcode+ • Jan 04, 2014 release 122 • Support for Energia 11 IDE, BLuno and Microduino boards


This cumulated release includes support for two new boards, DFRobot BLuno and Microduino; updated support for the new release 11 of Energia, and improvements for the Stellaris now Tiva C Series LaunchPad.

Happy coding :)

Download

avenue33

Want to provide feed-back and vote for the next features on embedXcode?

Try the new feed-back page at embedxcode.idea.informer.com.

My plan is to proceed with an initial test for a couple of months before full implementation.

Go Up