Advertisement
pleasedontcode

Lookup Table example

Aug 29th, 2024
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Arduino 0.26 KB | Source Code | 0 0
  1. const int lookupTable[] PROGMEM = {1, 2, 3, 4, 5};  // Store lookup table in FLASH
  2.  
  3. void useLookupTable() {
  4.     for (int i = 0; i < 5; i++) {
  5.         int value = pgm_read_word_near(lookupTable + i);  // Read from FLASH
  6.         Serial.println(value);
  7.     }
  8. }
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement