{"id":282,"date":"2018-05-31T13:35:38","date_gmt":"2018-05-31T13:35:38","guid":{"rendered":"https:\/\/arduino-developer.com\/arduino\/?p=282"},"modified":"2019-03-28T18:19:24","modified_gmt":"2019-03-28T18:19:24","slug":"ram","status":"publish","type":"post","link":"https:\/\/arduino-developer.com\/arduino\/programming\/memory\/ram","title":{"rendered":"RAM"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Ram used in interrupts<\/h4>\n\n\n\n<p>Use volatile:<\/p>\n\n\n\n<p>volatile byte my_variable_name;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Stopping constants using RAM <\/h4>\n\n\n\n<p>Use the F macro to move string literals to program memory. Serial.print(&#8220;some string&#8221;) is stored in RAM (dynamic memory), Serial.print(F(&#8220;some string literal&#8221;) is stored in program memory. \u00a0Any function that uses the print class functions can use the F macro (e.g.client.print).\u00a0 <\/p>\n\n\n\n<p>Use <a href=\"https:\/\/www.arduino.cc\/reference\/en\/language\/variables\/utilities\/progmem\/\">progmem<\/a> to move stuff to program memory. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Set array to value <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>byte data[100]\nmemset(data, 0, 100);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ram used in interrupts Use volatile: volatile byte my_variable_name; Stopping constants using RAM Use the F macro to move string literals to program memory. Serial.print(&#8220;some string&#8221;) is stored in RAM (dynamic memory), Serial.print(F(&#8220;some string literal&#8221;) is stored in program memory. \u00a0Any function that uses the print class functions can use the F macro (e.g.client.print).\u00a0 Use [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-282","post","type-post","status-publish","format-standard","hentry","category-memory"],"_links":{"self":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/comments?post=282"}],"version-history":[{"count":3,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/282\/revisions"}],"predecessor-version":[{"id":380,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/282\/revisions\/380"}],"wp:attachment":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/media?parent=282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/categories?post=282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/tags?post=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}