Jump to content

rose

Members
  • Content Count

    5
  • Joined

  • Last visited

About rose

  • Rank
    Noob Class

Profile Information

  • Gender
    Not Telling
  1. i am now using a seperate usb cable for the servo, but it still isnt responding to the program, any help would be appreciated
  2. i uploaded the modified sketch and it didnt respond at all in parallax, the computer can detect the device, as in device manager you can see in the COM section "MSP430 Application UART" as a device, and parallax detects it as well, im not quite sure why it isnt communicating. edit: i should also add that i am using the msp-exp430g2 rev1.4, and i have crossed the txd and rxd pins on J3. i should also add that me servo is a standard servo from radio shack, and although it says the voltage is 4.8 to 6v, i tried a 5v wall plug and the servo would turn clockwise until it couldnt any more every time it was plugged in, and is now powered by the gnd and vcc pins on J6, and is functioning properly(as ive said before), as it turns to the programmed default angle when plugged in, as it should, the servo just doesnt respond when you try to give it a command. i feel like it is an issue with some setting or program on my computer interfering or just not set properlly.
  3. ive compiled and uploaded my code (below) and when plug my msp430g2553 in it goes to the programmed angle it should when plugged in, but when i run the exe that is supposed to change its angle it doesnt do anything. the exe is programmed to connect to com4, and the msp430 application uart is set to com4. i know the exe can detect it because it wont run unless it can, it just isnt responding. im am using energia 0101E0010 to compile and upload. any help would be appreciated. here is the code: #include <Servo.h> Servo myServo; const int servoPin = 9; // the pin the servo is connected to int val = 0; // a value accumulated from data on the serial port int angle = 90; // the current angle of the servo void setup() { Serial.begin(9600); myServo.attach(servoPin); myServo.write(angle); // center the servo } void loop() { if ( Serial.available()) { char ch = Serial.read(); if(ch >= '0' && ch <= '9') // is ch a number? val = val * 10 + ch - '0'; // yes, accumulate the value else if(ch == '-') // is this the minus sign? { angle = angle - val; if(angle < 0) angle = 0; myServo.write(angle); // write the new angle val = 0; } else if(ch == '+') // is this the plus sign? { angle = angle + val; if(angle > 180) angle = 180; myServo.write(angle); // write the new angle val = 0; } } }
  4. ok, solved the problem, the 2231 didnt have enough memory, i tried the 2553 and it compiled fine.
  5. ive been trying to compile a sketch for about 3 days now, and ive finally gotten it down to one error, In file included from C:\Users\Matt\Desktop\...\energia-0101E0010\hardware\msp430\libraries\TimerSerial/stdint.h:32:0, from C:\Users\Matt\Desktop\...\energia-0101E0010\hardware\msp430\libraries\TimerSerial/inttypes.h:37, from C:\Users\Matt\Desktop\...\energia-0101E0010\hardware\msp430\cores\msp430/TimerSerial.h:27, from arduino.ino:1: C:\Users\Matt\Desktop\...\energia-0101E0010\hardware\msp430\libraries\TimerSerial/tr1/cstdint:34:28: fatal error: bits/c++config.h: No such file or directory compilation terminated. i know 'c++config.h' needs c++0x enabled to work, but i dont know how to enable it to compile with c++0x enabled. I dont care if certain things are out of date, i just need to know how to make this work. if you need my original sketch for some reason, here it is, #include <TimerSerial.h> #include <inttypes.h> #include <Servo.h> #include <stdint.h> Servo myServo; const int servoPin = 9; // the pin the servo is connected to int val = 0; // a value accumulated from data on the serial port int angle = 90; // the current angle of the servo void setup() { Serial.begin(4800); myServo.attach(servoPin); myServo.write(angle); // center the servo } void loop() { int value = map(analogRead(A0), 0, 1023, 0, 255); Serial.println(value); if ( Serial.available()); { char ch = Serial.read(); if(ch >= '0' && ch <= '9') // is ch a number? val = val * 10 + ch - '0'; // yes, accumulate the value else if(ch == '-') // is this the minus sign? { angle = angle - val; if(angle < 0) angle = 0; myServo.write(angle); // write the new angle val = 0; } else if(ch == '+') // is this the plus sign? { angle = angle + val; if(angle > 180) angle = 180; myServo.write(angle); // write the new angle val = 0; } } } any help with the error would be appreciated, thanks. edit: and by the way, im using the msp430g2231, and yes it is connected to a "serial" port, so to speak, this explains what i mean https://www.youtube.com/watch?v=1yEMZofNRyM
×