Advertisement
Guest User

Untitled

a guest
Nov 15th, 2010
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.36 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement