1. A system comprising: flash memory cells; and a flash controller, the flash controller configured to: receive a threshold voltage value, the threshold voltage value calculated based on at least one environmental variable; and write a data value to a flash memory cell of the flash memory cells using the threshold voltage value as a target threshold voltage.