This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/LP-CC2652RB: LP-CC2652RB

Part Number: LP-CC2652RB

Tool/software: Code Composer Studio

slave.txt
#include <SPI.h>
#include <SD.h>
#include <AltSoftSerial.h>
File myFile;
String Data;
#define RX 8
#define TX 9
AltSoftSerial mySerial(8, 9);
const int buzzer = 7; 
const int buttonPin = 2;
int buttonState = 0;
int lastButtonState = LOW;
unsigned long lastDebounceTime = 0;  // the last time the output pin was toggled
unsigned long debounceDelay = 100;    // the debounce time; increase if the output flickers

void setup() 
{
  pinMode(buttonPin, INPUT);
  pinMode(buzzer, OUTPUT);
  digitalWrite(buzzer,HIGH);
  Serial.begin(9600);
  mySerial.begin(9600);
  while (!Serial)
  {
    ; 
  }
  Serial.print("Initializing SD card...");
  if (!SD.begin(4)) 
  {
    Serial.println("Card failed, or not present");
    return;
  }
  Serial.println("card initialized.");
}

void loop() 
{
  unsigned long int time2;
  while(mySerial.available())
  {
    time2 = millis();
    if (time2 < 240000)
    {
      digitalWrite(buzzer,HIGH);
      Data = mySerial.readStringUntil('\n');
      File dataFile = SD.open("datalog.txt", FILE_WRITE);
      if (dataFile) 
        {
          dataFile.println(Data);
          dataFile.close();
        }
     }
      else if ((240000 < time2) &&(time2 < 300000))
   { 
         tone(buzzer, 2000); // Send 1KHz sound signal...
         delay(1000);        // ...for 1 sec
         noTone(buzzer);     // Stop sound...
         delay(1000);        // ...for 1sec 
         File dataFile = SD.open("datalog.txt", FILE_WRITE);
         dataFile.println("End of File");
         dataFile.close();
   }
     else
     {
      digitalWrite(buzzer,HIGH);
      int reading = digitalRead(buttonPin);
      buttonState = digitalRead(buttonPin);
         if (reading != lastButtonState)
     {
         lastDebounceTime = millis();
     }
     if ((millis() - lastDebounceTime) > debounceDelay) 
     {
       if (reading != buttonState) 
     {
       buttonState = reading;
       if (buttonState == HIGH) 
      {
        File dataFile = SD.open("datalog.txt");
        if (dataFile)
        {
         while (dataFile.available()) 
        {
          Serial.write(dataFile.read());
        }
       dataFile.close();
       }
  else 
  {
    Serial.println("error opening datalog.txt");
  }
  } 
  }
  }
  lastButtonState = reading; 
  }
  }   
}
How can i port this arduino code to TICCS code for the same function?