I am posting a support question on the forum so I can answer it here to help out others that may have a similar problem.
"
I downloaded the latest analogshield library from git hub. I'm trying to get the following code to compile in MPIDE:
#include <analogShield.h> //Include to use analog shield.
#include <SPI.h> //required for ChipKIT but does not affect Arduino
#include <SoftwareSerial.h>
// anndrews pins
SoftwareSerial rs(4,7); //rx,tx
// johns pins
//SoftwareSerial rs(2,3); //rx,tx
void setup()
{
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Serial.begin(115200);
rs.begin(115200);
Serial.println("Test");
}
void loop()
{
}
Compile errors are:
In file included from C:mpidelibrariesSPI/SPI.h:16:0,
from C:mpidelibrariesanalogShield/analogShield.h:54,
from sketch_mar24a.cpp:1:
C:MPIDEhardwarepic32corespic32/avr/pgmspace.h:4:2: error: #error ******** This sketch or library uses AVR-specific code that may not work with the chipKIT platform. See this forum for more information on porting code to chipKIT [www.chipkit.org/forum/viewforum.php?f=7] ********
In file included from C:mpidelibrariesanalogShield/analogShield.h:54:0,
from sketch_mar24a.cpp:1:
C:mpidelibrariesSPI/SPI.h: In static member function 'static byte SPIClass::transfer(byte)':
C:mpidelibrariesSPI/SPI.h:56:3: error: 'SPDR' was not declared in this scope
C:mpidelibrariesSPI/SPI.h:57:12: error: 'SPSR' was not declared in this scope
C:mpidelibrariesSPI/SPI.h:57:19: error: 'SPIF' was not declared in this scope
C:mpidelibrariesSPI/SPI.h: In static member function 'static void SPIClass::attachInterrupt()':
C:mpidelibrariesSPI/SPI.h:63:3: error: 'SPCR' was not declared in this scope
C:mpidelibrariesSPI/SPI.h:63:11: error: 'SPIE' was not declared in this scope
C:mpidelibrariesSPI/SPI.h: In static member function 'static void SPIClass::detachInterrupt()':
C:mpidelibrariesSPI/SPI.h:67:3: error: 'SPCR' was not declared in this scope
C:mpidelibrariesSPI/SPI.h:67:12: error: 'SPIE' was not declared in this scope
"
The errors are because the tools are trying to compile the Arduino side of the library. I am curious why that is happening.
I tried your code on my machine and did not have any compile issues so lets figure out what is going on.
Question
mwingerson
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.