Skip to content

Instantly share code, notes, and snippets.

@awensaunders
Created May 27, 2016 06:44
Show Gist options
  • Save awensaunders/f538d6a61961fc20f9dc11b0c29c8ec0 to your computer and use it in GitHub Desktop.
Save awensaunders/f538d6a61961fc20f9dc11b0c29c8ec0 to your computer and use it in GitHub Desktop.
This script uses i2c-tools to flash a new edid to a display (if the EEPROM storing the edid is not write-protected)
#!/usr/bin/env python3
import subprocess
import time
i2cbus = 3 #This is important. Check which bus your DDC is on with i2cdetect.
offset = 0x00 #Where to start writing
data = [0x00, 0xFF, 0xFF, 0xFF, 0xFF,...] #Your EDID Goes here
for value in data:
print("value", hex(value), "offset", hex(offset)) #for debuging
print(subprocess.check_output(["i2cset", "-y", str(i2cbus), "0x50", str(hex(offset)), str(hex(value))]))
time.sleep(0.1) #Makes sure we finish before moving on
offset += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment