V
V
Vladimir Shu2012-09-05 17:11:02
Microcontrollers
Vladimir Shu, 2012-09-05 17:11:02

MSP430 Lanchpad, how to correctly send data to serial port?

Play around, on occasion I bought Lanchpad MSP430.
So in this kind of thing, a complete zero, slowly master the table.
The diode blinked, reacted to the buttons and met me in the examples of sending messages to the serial port.

void setup() {
  Serial.begin(9600);
}
void loop() {
    Serial.println(myStrings[i]);
}

I opened the example, compiled it, uploaded it and ... and silence in the Serial Monitor.
I added a little script, loaded again and again silence.
I got into the header file HardwareSerial.h (from Energia 0101E0008), but there is no "println"
Here is the code that is now flashed:
const int ledPin_g =  GREEN_LED;
const int ledPin_r =  RED_LED;

// variables will change:
char* myStrings[]={
  "This is string 1", "This is string 2", "This is string 3",
  "This is string 4", "This is string 5","This is string 6"};

void setup() {
  pinMode(ledPin_g, OUTPUT);
  pinMode(ledPin_r, OUTPUT);
  // initialize serial communication:
  Serial.begin(9600);
}

void loop() {
  for (int i = 0; i < 6; i++){
    Serial.println(myStrings[i]);
    digitalWrite(ledPin_g, HIGH);
    delay(130); // arbitary wait time.
    digitalWrite(ledPin_g, LOW);
    delay(170); // arbitary wait time.

  }
  digitalWrite(ledPin_r, HIGH);
  delay(100); // arbitary wait time.
  digitalWrite(ledPin_r, LOW);
  delay(100); // arbitary wait time.  
}

Accordingly, I would like to know from Knowledgeable people what I am doing wrong and how to do it right?
PS.
Work in Energia 0101E0008 is performed on Win 7x64 pro with admin rights.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vlad Zaitsev, 2012-09-11
@BoxaShu

Jumpers soft-hard uart thrown?

S
s01o, 2012-09-11
@s01o

I don't understand much about this, but I had a similar problem and solved it like this:

TimerSerial mySerial;
void setup() {
 mySerial.begin();
mySerial.println("Callibrating");  
}

V
Vladimir Shu, 2012-09-17
@BoxaShu

The software I uploaded:

#include <TimerSerial.h>
TimerSerial mySerial;
void setup() {
  mySerial.begin();
  mySerial.println("Callibrating");  
}
void loop() {
    Serial.println("Callibrating");
    delay(1700); 
}

The result of the work of the filler.
Binary sketch size: 1 732 bytes (of a 16 384 byte maximum)
Erasing...
Programming...
Done, 1732 bytes written

Total: Silence on the COM port.
Apparently it's really all about the jumpers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question