# F Micro can do this?

**URL:** <https://forum.arduino.cc/t/f-micro-can-do-this/1006875>\
**Category:** Programming\
**Created:** [June 26, 2022, 11:54pm UTC](https://forum.arduino.cc/t/f-micro-can-do-this/1006875 "2022-06-26T23:54:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![RAM\_ELECTRONICS](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ram_electronics/32/1276898_2.png) [@RAM\_ELECTRONICS](https://forum.arduino.cc/u/RAM_ELECTRONICS)\
**Post date:** [June 26, 2022, 11:54pm UTC](https://forum.arduino.cc/t/f-micro-can-do-this/1006875/1 "2022-06-26T23:54:12Z")

</div>

I am trying to figure out all about F micro.

I know it can do:

`Serial.print (F("Hello World!"));`

But can do this?

```cpp
array[] = {"BOB", "PAT", "MEL", "KIM"};
for (int i = 0; i <= 3; i++)
  {
   Serial.print(F(array[i]));
  }

```

?

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [June 27, 2022, 12:21am UTC](https://forum.arduino.cc/t/f-micro-can-do-this/1006875/2 "2022-06-27T00:21:17Z")

</div>

The F macro is used to indicate that a literal should not occupy RAM storage.  
Your (pseudo code) array is already in RAM.  
Look at PROGMEM for more general data structures to be held only in flash memory.

---

<div class="post-metadata">

**Author:** ![cattledog](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cattledog/32/217816_2.png) [@cattledog](https://forum.arduino.cc/u/cattledog)\
**Post date:** [June 27, 2022, 12:24am UTC](https://forum.arduino.cc/t/f-micro-can-do-this/1006875/3 "2022-06-27T00:24:52Z")

</div>

There is example PROGMEM code for an array of character strings here

https://www.arduino.cc/reference/en/language/variables/utilities/progmem/

---

<div class="post-metadata">

**Author:** ![RAM\_ELECTRONICS](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ram_electronics/32/1276898_2.png) [@RAM\_ELECTRONICS](https://forum.arduino.cc/u/RAM_ELECTRONICS)\
**Post date:** [June 27, 2022, 3:00am UTC](https://forum.arduino.cc/t/f-micro-can-do-this/1006875/4 "2022-06-27T03:00:29Z")

</div>

THANK YOU ALL! it's worked.

---

<div class="post-metadata">

**Author:** ![RAM\_ELECTRONICS](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ram_electronics/32/1276898_2.png) [@RAM\_ELECTRONICS](https://forum.arduino.cc/u/RAM_ELECTRONICS)\
**Post date:** [June 28, 2022, 4:26pm UTC](https://forum.arduino.cc/t/f-micro-can-do-this/1006875/5 "2022-06-28T16:26:52Z")

</div>

Umm, I have issue for PROGMEM... I see the PROGMEM is read-only. anything can I re-write data in PROGMEM?

---

<div class="post-metadata">

**Author:** ![cattledog](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cattledog/32/217816_2.png) [@cattledog](https://forum.arduino.cc/u/cattledog)\
**Post date:** [June 28, 2022, 6:34pm UTC](https://forum.arduino.cc/t/f-micro-can-do-this/1006875/6 "2022-06-28T18:34:00Z")

</div>

> [@RAM\_ELECTRONICS](#):
>
> I see the PROGMEM is read-only

Correct. You will need to look for another solution like using EEPROM, an SD card, or FRAM memory.

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [June 28, 2022, 7:35pm UTC](https://forum.arduino.cc/t/f-micro-can-do-this/1006875/7 "2022-06-28T19:35:06Z")

</div>

With some boards and with various degrees of trickery, it is possible also to write at run time to flash memory (which PROGMEM also uses).  
If you have an AVR (UNO etc.) there are tricks via some bootloaders which permit writing to flash.  
With an ESP it is easier and even the "EEPROM" is emulated in flash memory.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [December 25, 2022, 7:35pm UTC](https://forum.arduino.cc/t/f-micro-can-do-this/1006875/8 "2022-12-25T19:35:37Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
