Note that there are some explanatory texts on larger screens.

plurals
  1. POXcode to develop for the Arduino
    primarykey
    data
    text
    <p>Please read this well to make sure you understand what I want to do.</p> <ul> <li>I DO want Xcode to be able to compile, but only so I can debug in Xcode.</li> <li>I do NOT want to use Xcode to compile or upload the code to the Arduino board. I will use the Arduino IDE in "Use external editor" mode instead.</li> </ul> <p>What I have done (also as a future reference for people who might want to do the same thing):</p> <ul> <li>In the project settings (click on the project file in the left pane)</li> <li>I have changed the compiler to GCC to avoid many errors.</li> <li><p>I have added the following paths to the Header Search Paths and Library Search Paths:</p> <ul> <li>/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/lib/gcc/avr/4.3.2/include</li> <li>/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/include</li> <li>/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino</li> </ul></li> </ul> <p>(If you have installed Arduino.app somewhere other than the Applications folder, you will need to adjust the paths accordingly.)</p> <p>In main.cpp, I have included <code>&lt;WProgram.h&gt;</code>, but it wasn't enough. I was getting undefined identifier errors (for SPCR, SPE, MSTR, SPR1, SPR0) due to not being able to pass the <code>-mmcu=somechipname</code> as a flag to the compiler, which caused no device to be defined and <code>avr/io.h</code> to be unable to include the file that defined those symbols. I got around it by manually including <code>&lt;avr/iom328p.h&gt;</code> which is the appropriate header file for my chip.</p> <p>That's how far I got.</p> <p>Now I get these errors:</p> <pre><code>Undefined symbols for architecture i386: "_init", referenced from: _main in main.o "_setup", referenced from: _main in main.o "_loop", referenced from: _main in main.o "_pinMode", referenced from: SBSetup() in main.o "_digitalWrite", referenced from: SBSetup() in main.o </code></pre> <p>The whole main.cpp including the evil offending code is this:</p> <pre><code>#include &lt;WProgram.h&gt; #include &lt;avr/iom328p.h&gt; // Getting around warning "device type not defined" #define NumLEDs 25 #define clockpin 13 // CI #define enablepin 10 // EI #define latchpin 9 // LI #define datapin 11 // DI int LEDChannels[NumLEDs][3] = {0}; int SB_CommandMode; int SB_RedCommand; int SB_GreenCommand; int SB_BlueCommand; void SBSetup(void) { pinMode(datapin, OUTPUT); pinMode(latchpin, OUTPUT); pinMode(enablepin, OUTPUT); pinMode(clockpin, OUTPUT); SPCR = (1&lt;&lt;SPE)|(1&lt;&lt;MSTR)|(0&lt;&lt;SPR1)|(0&lt;&lt;SPR0); digitalWrite(latchpin, LOW); digitalWrite(enablepin, LOW); } int main(void) { init(); setup(); for (;;) loop(); return 0; } </code></pre> <p>What do I about this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload