Jump to content
43oh

craggmire

Members
  • Content Count

    7
  • Joined

  • Last visited

Reputation Activity

  1. Like
    craggmire reacted to igor in Serial Communication with External Devices   
    I think the CC3200 has 2 serial ports - could try Serial1, which according to the Pinout has RX on pin 10 (same as green LED).
  2. Like
    craggmire reacted to zeke in Serial Communication with External Devices   
    Try 4800 baud instead of 9600.
  3. Like
    craggmire got a reaction from spirilis in Non volatile memory options for cc3200   
    I have put this code together to demonstrate the creation write and read of data to and then from SRAM.
     
    I have avoided using the readBytes function and instead just use read(); for the reading in bit. 
     
    // Craggmire  8th  November 2014 // CREATE, OPEN & READ demo using SLFS for TO CC3200 #include <WiFi.h>//Even if no WiFi used this file is essential #include <SLFS.h>//SLFS slfs(); //this creates and instance slfs of the Class SLFS (TI's simpleLink Filing System)   void setup() {   char initialCharacterString[100]="BrightonToLondonViaEridgeLine";   char readInString[100];     int openok;   int filelengthWritten;   int readStatus;   int ValueReturnedByRead;   int n;     Serial.begin(9600);//sets serial line to a manageable speed   Serial.println("Start");   Serial.println("The Initial String: ");   Serial.println("-----------------------------");   Serial.println(initialCharacterString);   Serial.println("-----------------------------");      // BEGIN SLFS     SerFlash.begin();//Essential fof SLFS sets up the DMA etc actually seems to do a WiFi.init(); function call     // THIS CREATES THE FILE ---------------------------   openok=SerFlash.open("myfile.txt", FS_MODE_OPEN_CREATE(1024, _FS_FILE_OPEN_FLAG_COMMIT));// create and open the file with this name   Serial.print("File created :  ");    Serial.println(openok);     // THIS OPENS THE FILE FOR WRITING -----------------   openok=SerFlash.open("myfile.txt", FS_MODE_OPEN_WRITE);  //open ile for writing to   Serial.print("File Opened : ");    Serial.println(openok);   filelengthWritten =SerFlash.write(initialCharacterString);// write content to the file   Serial.print("File length WRITTEN out : ");    Serial.println(filelengthWritten);   SerFlash.close();// close the file      // READ IN THE FILE FROM SRAM --------------------------   Serial.println("=============================");   Serial.println("---- File now being read:");   readStatus= SerFlash.open("myfile.txt", FS_MODE_OPEN_READ);    Serial.print("File Read Status: ");   Serial.println(readStatus);   Serial.println("String returned by Read(): ");   Serial.println("-----------------------------");   n=0;   do   {     ValueReturnedByRead=SerFlash.read();      if  (ValueReturnedByRead != -1)     {       readInString[n]= (char)ValueReturnedByRead; //integer cast to char       Serial.print(readInString[n]);         n++;     }   }   while (ValueReturnedByRead != -1);   Serial.println();   Serial.println("-----------------------------");   SerFlash.close();// close the file }   void loop() { }
×
×
  • Create New...