Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 15th, 2010  |  syntax: C  |  size: 1.36 KB  |  views: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //************************************************************************
  2. //*     Arduino String Memory test
  3. //*      Created, 3 strings, check memory status.
  4. //*
  5. //*             (C) 2010 by Rick Anderson
  6. //*             Open source as per standard Arduino code
  7. //*
  8. //************************************************************************
  9. //*     Oct 16, 2010    <ROA> Started on String Test
  10. //************************************************************************
  11.  
  12. #include        "WProgram.h"
  13. #include        "HardwareSerial.h"
  14. #include        <ArduinoTestSuite.h>
  15.  
  16. //************************************************************************
  17. void setup()
  18. {
  19.   char testName[64];
  20.   int           startMemoryUsage;
  21.   /*
  22.     * Create variable for the tests.
  23.    */
  24.  
  25.  
  26.   String stringOne;
  27.  
  28.   //Assign stringOne to be equal to the longest string
  29.   stringOne = "<p>Lorem ipsum dolor sit amet</p><p>Ipsem</p><p>Quod</p>";
  30.  
  31.   /*;
  32.    * initiate the test run
  33.    */
  34.   startMemoryUsage      =       ATS_GetFreeMemory();
  35.   ATS_begin("Arduino", "String Memory Test");
  36.  
  37.   stringOne = "<HTML><HEAD><BODY>";
  38.   stringOne = "<UL><LI>item<LI>item<LI>item</UL>";
  39.   stringOne = "<p>Lorem ipsum dolor sit amet</p><p>Ipsem</p><p>Quod</p>";
  40.  
  41.   ATS_ReportMemoryUsage(startMemoryUsage);
  42.  
  43.   /*
  44.    * Test complete
  45.    */
  46.  
  47.   ATS_end();
  48.  
  49. }
  50.  
  51.  
  52. //************************************************************************
  53. void loop()
  54. {
  55.  
  56.  
  57. }
clone this paste RAW Paste Data