P
P
Paul Smith @Paul2013-01-06 18:07:03
Arduino
Paul Smith @Paul, 2013-01-06 18:07:03

Msp430 - How to work with Serial when Servo.h is connected?

I call for your help.
I'm trying to control a servo by reading data from Serial: inByte = Serial.read();
I connect Servo.h
Immediately when compiling, it gets out:

core.a(TimerSerial.cpp.o): In function `TimerSerial__TxIsr':
C:\Users\Paul\Documents\Energia\hardware\msp430\cores\msp430/TimerSerial.cpp:202: multiple definition of `__isr_9'
Servo\ Servo.cpp.o:C:\Users\Paul\Documents\Energia\hardware\msp430\libraries\Servo/Servo.cpp:87: first defined here
collect2: ld returned 1 exit status

Program source code:
#include <Servo.h>
void setup()
{
  // start serial port at 9600 bps:
  Serial.begin(9600);
}

void loop()
{
  // if we get a valid byte, read analog ins:
  if (Serial.available() > 0) {
    // get incoming byte:
    inByte = Serial.read();
 
    if(inByte == 'w'){
   // Do something
    }   
Serial.write(inByte);    //Write what we get
  }
}

Obviously the serial and servo libraries use the same timer to operate.
The task is to receive data via Serial, check them. If the character 'w' came, move the servo.
Question: How?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2013-01-06
Smith

What MC are you trying to use? in 452 - serial is only software, and in 553 - already hardware.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question