     setup_buffer();
     display_buffer();
   }
+}
+
+// Compute a random seed by sampling an unconnected analog input pin 
+int random_seed(){
+  int seed = analogRead(RANDOM_SEED_PIN);
+  for(int i = 0; i < 16; i++){
+    seed = (seed << 1) ^ analogRead(0);  
+  }
+  randomSeed(seed);
 }
 
 void setup() { 

rgb_color purple = {10, 0, 20};
rgb_color magenta = {20, 0, 20};
rgb_color pink = {20, 0, 10};

#define NPALETTE 6
#define NPRETTY_COLORS 6
rgb_color palette[NPALETTE] = { red, orange, yellow, green, blue, purple };
//rgb_color palette[NPALETTE] = { red, orange, pink, magenta,      yellow, green, seafoam, ltgreen,       ltblue, cyan, blue, purple,        white }; 

rgb_color adjusted_palette[NPALETTE];

rgb_color scale_color(rgb_color color, float scale){

  Serial1.begin(57600);  // open internal serial connection to 
                         //MT7688
  //pinMode(13, OUTPUT); // in MT7688, this maps to device 

  random_seed();
  setup_colors(false);
  erase(true);
}
