Skip to content
Discussion options

You must be logged in to vote

this script sets display brightness and inversion with webui on esp8266

>D
p:bright=0
p:inv=0
res=0
i2c=0

>B
i2c=ia(0x3c)
if i2c==0 {
	print device not present
} else {
	res=0x8100|bright
	if inv==0 {
		iw(0 0xa6)
	} else {
		iw(0 0xa7)
	}
	iw2(0x4000 res)
}

>S
if i2c>0 {
	if chg[bright]>0 {
		res=0x8100|bright
		iw2(0x4000 res)
		print setting brightness to %bright%
	}
	if chg[inv]>0 {
		if inv==0 {
			iw(0 0xa6)
		} else {
			iw(0 0xa7)
		}
		print setting display invert
	}	
	
}


>W
sl(0 255 bright "0" "brightness" "255")
ck(inv "invert  ")

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
3 replies
@pimlie
Comment options

@s-hadinger
Comment options

@pimlie
Comment options

Comment options

You must be logged in to vote
4 replies
@pimlie
Comment options

@s-hadinger
Comment options

@gemu2015
Comment options

Answer selected by pimlie
@pimlie
Comment options

Comment options

You must be logged in to vote
1 reply
@pimlie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants