gettingbored 0 Posted June 10, 2012 Share Posted June 10, 2012 So I installed Energia on my Mac, and even though the launchpad isn't listed under the serial ports I can still upload to it for some reason. However when I installed the program it didn't come with a Servo library. So I went to https://github.com/energia/Energia and downloaded the Servo library, poped open the contents of of the Energia program and stuck it with the other libraries. When I try to compile it though I get this error: /Applications/Energia.app/Contents/Resources/Java/hardware/msp430/libraries/Servo/Servo.cpp:45:27: fatal error: avr/interrupt.h: No such file or directory compilation terminated. So basically, How do I add libraries to Energia? Quote Link to post Share on other sites
energia 485 Posted June 10, 2012 Share Posted June 10, 2012 Servo lib has not been ported to msp430 yet hence it was not included in the release. A enhancement request (https://github.com/energia/Energia/issues/69) has been files. pbrier, one of the project members, is working on it. Once it has been ported a pull request will show up in that ticket. The library will show up in hardware/msp430/libraries once we pull it into master. Quote Link to post Share on other sites
gettingbored 0 Posted June 10, 2012 Author Share Posted June 10, 2012 Ok that sounds good to me. Quote Link to post Share on other sites
skall34 0 Posted July 23, 2012 Share Posted July 23, 2012 Hi, I've met the same problem. Is the servo library available finally ? optionnally, I can make a one, but I don't want to make something if someone else is already doing it... maybe it won't be the best one, but I was able to make my stuf move... Quote Link to post Share on other sites
energia 485 Posted July 24, 2012 Share Posted July 24, 2012 Servo lib has been ported and will be part of the next release slated for this week. If you can't wait then you can get it here: https://github.com/energia/Energia/tree ... ries/Servo Quote Link to post Share on other sites
Rei Vilo 695 Posted July 24, 2012 Share Posted July 24, 2012 Generally speaking, here's the procedure to add a library to Energia: Define the folder for the sketchbook: menu Energia > Preferences > Sketchbook Location eg. ~/Documents/Energia or /users/name/Documents/Energia jkjithin and jeshuah 2 Quote Link to post Share on other sites
skall34 0 Posted July 24, 2012 Share Posted July 24, 2012 thanks ! I just replaced my own servo management by the use of the servo lib, and it works perfectly... Quote Link to post Share on other sites
bcarroll 2 Posted August 29, 2012 Share Posted August 29, 2012 I am trying to use the Servo library but am getting a compile error: core.a(TimerSerial.cpp.o): In function `TimerSerial__TxIsr': C:\energia-0101E0008\hardware\msp430\cores\msp430/TimerSerial.cpp:202: multiple definition of `__isr_9' Servo\Servo.cpp.o:C:\energia-0101E0008\hardware\msp430\libraries\Servo/Servo.cpp:87: first defined here collect2: ld returned 1 exit status Am I doing something wrong? Here is my code: //get a number from Serial and move a servo to that position (no error/limit checking implemented yet) #include #define baudrate 9600 #define servoPin P1_4 int inByte = 0; // incoming serial byte char inData[3]; // serial input array (buffer) int index = 0; Servo myservo; // create servo object to control a servo void setup(){ Serial.begin(baudrate); myservo.attach(servoPin); } void loop(){ if (Serial.available() > 0) { inByte = Serial.read(); inData[index] = inByte; index++; if (index > 2 || inByte == 10 || inByte == 13){ //buffer is full or we got a charage return or linefeed inData[index] = '\0'; //Null terminate the string Serial.println(inData); myservo.write(atoi(inData)); // sets the servo position according to the scaled value delay(15); // waits for the servo to get there index = 0; } } } Quote Link to post Share on other sites
Rickta59 589 Posted August 29, 2012 Share Posted August 29, 2012 Your Servo.h and TImerSerial both want to use the same Timer interrupt. Which chip are you using? I'm guessing the g2452 or g2231. You will have to use the g2553 if you want to use both Serial and something that uses the Timer interrupt. Quote Link to post Share on other sites
bcarroll 2 Posted August 29, 2012 Share Posted August 29, 2012 I am using the g2452. Any way to work around this limitation? Quote Link to post Share on other sites
Rickta59 589 Posted August 29, 2012 Share Posted August 29, 2012 Not without a deeper understanding of the hardware. The easiest solution is to get an msp430g2553 chip if you want to use simple code. bcarroll 1 Quote Link to post Share on other sites
bcarroll 2 Posted August 29, 2012 Share Posted August 29, 2012 I found an example that uses a servo and serial with the g2211, however the code doesn't compile in Energia. Here is the error I get: sketch_aug29a.cpp: In function 'void Timer_A1()': sketch_aug29a.cpp:265:14: error: 'TAIV_TACCR1' was not declared in this scope ...was getting an error about main needing to return an int, so I changed the code to int main(void) instead of void main(void) which fixed that issue... Here is the example: http://buildsmartrobots.ning.com/profiles/blogs/build-a-4-30-programmable-servo-controller Quote Link to post Share on other sites
fran52 0 Posted December 12, 2012 Share Posted December 12, 2012 error: avr/interrupt.h: No such file or directory Is there a avr subdirectory in the core? Quote Link to post Share on other sites
Rickta59 589 Posted December 12, 2012 Share Posted December 12, 2012 Anything code that uses #include "avr/something*" isn't going to work with the msp430 Eenergia. avr is used for the atmel avr chips. Quote Link to post Share on other sites
fran52 0 Posted December 12, 2012 Share Posted December 12, 2012 exactly!! 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.