trevsfire 2 Posted June 14, 2016 Share Posted June 14, 2016 hello, new here, having some problems. when I simply import the SPI library, I get numerous errors. is there a simple thing I'm doing wrong? I've tried looking but nobody else seems to be having the problem, help would be greatly appreciated. thanks. here's the code #include <SPI.h> void setup() { } void loop() { } and when compiled returns this error In file included from sketch_jun14b.cpp:1:0: C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h: In static member function 'static byte SPIClass::transfer(byte)': C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h:56:3: error: 'SPDR' was not declared in this scope C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h:57:12: error: 'SPSR' was not declared in this scope C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h:57:23: error: 'SPIF' was not declared in this scope C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h:57:27: error: '_BV' was not declared in this scope C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h: In static member function 'static void SPIClass::attachInterrupt()': C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h:63:3: error: 'SPCR' was not declared in this scope C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h:63:15: error: 'SPIE' was not declared in this scope C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h:63:19: error: '_BV' was not declared in this scope C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h: In static member function 'static void SPIClass::detachInterrupt()': C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h:67:3: error: 'SPCR' was not declared in this scope C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h:67:16: error: 'SPIE' was not declared in this scope C:\Users\tgkann\Documents\Energia\libraries\SPI/SPI.h:67:20: error: '_BV' was not declared in this scope Quote Link to post Share on other sites
spirilis 1,265 Posted June 14, 2016 Share Posted June 14, 2016 Energia ships with an SPI library for each of its platforms. Delete the one you just installed in your local copy; it's designed for Atmel AVR chips, not the TI chips. trevsfire and energia 2 Quote Link to post Share on other sites
trevsfire 2 Posted June 14, 2016 Author Share Posted June 14, 2016 I'm sorry, could you elaborate just a bit? do you mean to delete the SPI.h library? and if so, how do I use the chip specific spi library? thank you though. Quote Link to post Share on other sites
spirilis 1,265 Posted June 14, 2016 Share Posted June 14, 2016 Yes delete the SPI folder from C:\Users\tgkann\Documents\Energia\libraries\ Just #include <SPI.h> in your sketch and Energia will "automatically" include it. Quote Link to post Share on other sites
trevsfire 2 Posted June 14, 2016 Author Share Posted June 14, 2016 ah, i figured it would get a directory not found error. works perfectly, thank you. Quote Link to post Share on other sites
spirilis 1,265 Posted June 14, 2016 Share Posted June 14, 2016 ah, i figured it would get a directory not found error. works perfectly, thank you. Have a peek at <energia install location>\hardware\<platform>\libraries BTW... e.g.: C:\energia-0101E0017\hardware\msp430\libraries Some stuff might be in the core, which is also fun to peruse: C:\energia-0101E0017\hardware\msp430\cores\msp430 Quote Link to post Share on other sites
trevsfire 2 Posted June 14, 2016 Author Share Posted June 14, 2016 there's so cool stuff in here, might come in handy. thanks again for all the help. spirilis and abecedarian 2 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.