[decbin]
i = 1
r = 0
binval = 0
nr = decval
Do
r = nr % 2
nr = int(nr/2)
binval = binval + r*i
i = i*10
Loop while nr > 0
wait
Original article with full program code :
ESPBasic decimal-to-binary conversion code and test program
Looking forward to hear about your own ideas/solutions.
Happy breadboarding,
TJ.
Available on Tindie: https://www.tindie.com/products/nEXT_EVO1/universal-ac-mains-dimmer-mpdmv41/