Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: AltSoftSerial Project Help

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    3

    AltSoftSerial Project Help

    Hi,
    I am using an arduino UNO with a Atlas Scientific ENV-32x data logger.
    I want the arduino to send strings to the data logger, using software serial so it will work without PC connection.

    So just a basic intro, if the button is pressed on pin 5, the arduino should send "D" to the data logger, this command will delete the logger memory.
    Unfortunately, it seems like the data isnt making its way to the data logger for reasons I dont understand. (the logger has an LED that blinks when it receives data.)

    PS(All my wiring has been checked working, and the hardware is not broken.)

    Check out my code below.
    Thanks


    Code:
    #include <AltSoftSerial.h>
    
    AltSoftSerial altSerial;
    
    const int delBtn = 5;  
    int buttonStateDel = 0; 
    
    
    void setup() {
      
      pinMode(delBtn, INPUT); 
      
      Serial.begin(38400);
      Serial.println("AltSoftSerial Test Begin");
      altSerial.begin(38400);
    }
    
    void loop() {
      char c;
      byte cmd;
      buttonStateDel = digitalRead(delBtn);
      
      
      if (buttonStateDel == HIGH) {
    
    
    
            Serial.println("Del"); 
    
            altSerial.print("D");
      
      }
      
    
      
      if (altSerial.available()) {
        c = altSerial.read();
        Serial.print(c);
      }
      
      delay(500);
    }

  2. #2
    Member
    Join Date
    Nov 2012
    Location
    Olympia, WA
    Posts
    46
    If you can modify the code using the regular softwareserial library to work (as detailed here: https://www.atlas-scientific.com/_fi...ode-EZ-COM.pdf ) I am not sure what else altsoftserial would add other than throughput, which you don't need to send a "D" character.

    Disclaimer: I often miss the forest for the trees. I also hardcode pin numbers, remove code, and other simplifications until something works. Good luck!

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    Quote Originally Posted by bdor5285 View Post
    PS(All my wiring has been checked working, and the hardware is not broken.)
    I'm wondering how you can claim to have checked the wiring from pin 9 on your Uno to the serial input on the data logger?

  4. #4
    Junior Member
    Join Date
    Mar 2014
    Posts
    3
    Using the example in the altsoftserial library I was able to check the wiring by sending data to and from the device using serial. After speaking to a representative from the company I was told that the included SoftSerial is not sufficient for use with this device.

  5. #5
    Junior Member
    Join Date
    Mar 2014
    Posts
    12
    Here is the link from Atlas-Scientific to interface data-logger and arduino uno. This example specifically uses normal "SoftwareSerial" library. I hope you might find it useful.

    https://www.atlas-scientific.com/_fi...ode-EZ-COM.pdf

  6. #6
    Junior Member
    Join Date
    Mar 2014
    Posts
    3
    The support person I spoke with explained that this software does not work with the newest logger. I tried it and can garunteed that it doesn't.

  7. #7
    Junior Member
    Join Date
    Mar 2014
    Posts
    12
    Could you paste your circuit diagram and photo of actual connections?

    And also when you are sending any data you also have to send a 'Carriage Returns' i.e. <CR>. Remember in order to format the previous data you need to send "D<CR>D<CR>".
    Last edited by Deamon; 03-07-2014 at 01:24 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •