Jump to content
43oh

semicolo

Members
  • Content Count

    137
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by semicolo

  1. Great work guys.

     

    I think you've asked before if the previous version is displaying an update notification.

    Version 0101E0013 is not showing that an update is available on windows 8 64bits.

     

    Edit:

    But maybe that's because of the firewall at work, I'll try to remember testing it at home.

     

    Edit2:

    No notification at home either.

  2. The serial monitor is not supposed to print what you send.

    You cannot debug with energia, you have to use ti's code composer studio. Now you can load your energia sketches in CCS by the way.

    Send a picture of your setup so we can see if something is wrong with your jumpers.

  3. I don't have a 1.3 board but I don't see why you'd need to connect anything, the microcontroller pins should be connected to both the header and jumper field. If you connected a jumper between RXD and TXD, that explains why you see an echo of what you type in the serial monitor.

  4. This works on my launchpad:

    void setup()
    {
      Serial.begin(9600);
    }
    
    void loop()
    {
      if (Serial.available()) {
        long frequency = Serial.parseInt();
        Serial.println(frequency);
      }  
    }
    

    when I type a number, say 1234 in the serial monitor, the launchpad reads it in the frequency variable and prints it back to the serial monitor

     

    I find it strange that you see data in the serial monitor when your code doesn't send anything.

    Again try the Ascii table example you should see a bunch of lines when you hit reset on the launchpad and try the simpler code above to test reading in a variable.

  5. You have to initialize the hardware serial in the setup function:

    Serial.begin(9600); (9600 bps is the maximum speed using the launchpad usb serial)

     

    then in the loop wait for serial data and when available use Serial.parseInt()

     

    something like

    void loop() {
      if (Serial.available()) {
        long frequency = Serial.parseInt();
        sendFrequency(frequency);
      }  
    }
    

    Have a look at the Communications examples (in File/Examples/4.Communication)

    Run the ASCIITable example if you didn't already to make sure the jumpers on the launchpad are set correct, that's a common mistake for beginners.

  6. I have a few usb2serial cables based on the PL-2303X that is not supported anymore since windows 8 (you can actually install windows 7 drivers to make them work but it's a hassle). Never had a problem with these cables.

    Seems like other chips than PL-2303HXA and PL-2303X should have working drivers.

     

    I also tried high speed serial transfers with a stellaris launchpad once, I don't remember when it stopped being reliable but It could go up to a few Mbps (testing wasn't really scientific, the launchpad was just sending the ascii table over and over and I looked at some strange or out of place characters in the output).

  7. They're used in the 3d printers hot ends and heating beds.

     

    In university we used them in wheatstone bridges, if I remember well, it allows the resistance to be approximated to a line. Lot less useful now that it's easy to have a values table in a microcontroller.

  8. I use this program to test the servos I buy on ebay, just open the serial console and send single characters (space to go all the way on one side, up to z to go all the way on the other side). Set the line ending to "no line ending".

     

    Change MIN MAX to define the min/max angle of the servo.

    #include <Servo.h> 
    #define MIN 15
    #define MAX 165
    
    Servo myservo;  // create servo object to control a servo 
     
    int pos = 0;    // variable to store the servo position 
    
    int position (int value)
    {
      if (value>100)
        value=100;
      if (value<0)
        value=0;
      return map(value, 0, 100, MIN, MAX);
    }
    
    void setup() 
    { 
      myservo.attach(2);  // attaches the servo on pin 2 to the servo object 
      Serial.begin(9600);
      pos = 80;
      myservo.write(pos);
    } 
     
     
    void loop() 
    { 
      delay(15);
      if (Serial.available()) {
        int data = Serial.read();
        data -= ' ';
        pos = position(data);
        Serial.println(pos);
      }
      myservo.write(pos);
    } 
    
  9. I think it's the serial 9600bps that's holding the ADC frequency here, when the serial buffer is full, the Serial.print must be waiting until some chars are transmitted before returning.

     

    Try without the Serial.print

    void loop() {
      // read the analog in value:
      sensorValue = analogRead(analogInPin);            
      // map it to the range of the analog out:
      outputValue = map(sensorValue, 0, 1023, 0, 1023);  
      //outputValue = map(sensorValue, 0, 1023, 0, 255); 
      // change the analog out value:
      analogWrite(analogOutPin, outputValue);           
     
      delay(1);
      }
    
  10. The 15 bytes limit is probably due to the serial buffer, you have to send data at the serial rate or lower to not overrun the said buffer.

    Using while depends on the amount of data received/sent, if you work on single bytes, you can probably replace the while by ifs.

×
×
  • Create New...