User:Ssstephen/waves
printed in the terminal
% 1.9999118601072672 * 1.5290826861200237 * 0.571817330503849 * 0.008221146556884218 ~ 0.3564618666430005 * 1.2963685787093853 * 1.9637953862840878 * 1.7451131604793488 % 0.841377331195291 * 0.08347845208436622 % 0.1682252573714017 * 1.0177019251054136 ~ 1.8509035245341185 * 1.901788347648809 * 1.123573122745224 * 0.23174533867633318 % 0.04624734724052815 * 0.7376251462960712 * 1.6702291758433747 * 1.9866275920404854 ~ 1.3959251501818342 * 0.4412109511483837 * 0.000244826641380147 * 0.47844899791308815 % 1.436164755247825 * 1.9928726480845371 % 1.636738007139138 * 0.6951893788977833 ~ 0.03388222999160706 * 0.2608193033507772 * 1.167355700302807 * log@breadcube:~/public_html/week8$ python3 thermalprint2.py 1.0 % 1.0333271608367536 * 1.066617294923393 * 1.0998334166468282 * 1.1329386226223142 ~ 1.165896132693415 * 1.1986693307950613 * 1.2312218056342985 * 1.2635173911435351 % 1.2955202066613396 * 1.3271946967961523 % 1.3585056709286172 * 1.3894183423086506 ~ 1.4198983667038059 * 1.4499118805559996 * 1.479425538604203 * 1.5084065509313012 % 1.5368227193939612 * 1.5646424733950353 * 1.5918349049587528 * 1.6183698030697369 ~ 1.644217687237691 * 1.669349840250466 * 1.6937383400791204 * 1.7173560908995227 % 1.740176853196037 * 1.7621752729138396 % 1.7833269096274833 * 1.8036082636944113 ~ 1.8229968023632526 * 1.8414709848078965 * 1.8590102860595255 * 1.8755952198100254 % 1.8912073600614354 * 1.9058293615973811 * 1.9194449792537551 * 1.9320390859672263 ~ 1.9435976895815332 * 1.9541079483928832 * 1.963558185417193 * 1.9719379013633127 % 1.9792377862978257 * 1.9854497299884601 % 1.9905668309146254 * 1.9945834039350565 ~ 1.9974949866040546 * 1.9992983441292993 * 1.999991472965731 * 1.999573603041505 % 1.9980451986135481 * 1.995407957751765 * 1.9916648104524686 * 1.9868199153831307 ~ 1.9808786552620674 * 1.9738476308781951 * 1.9657346537574998 * 1.9565487374843666 % 1.9463000876874146 * 1.935000090700958 % 1.9226613009146958 * 1.9092974268256817 ~ 1.8949233158080703 * 1.8795549376175618 * 1.8632093666488738 * log@breadcube:~/public_html/week8$ python3 thermalprint2.py 0.0 % 0.03332716083675362 * 0.066617294923393 * 0.09983341664682815 * 0.13293862262231407 ~ 0.16589613269341502 * 0.19866933079506122 * 0.23122180563429856 * 0.26351739114353506 % 0.29552020666133955 * 0.3271946967961522 % 0.3585056709286172 * 0.3894183423086505 ~ 0.4198983667038058 * 0.4499118805559997 * 0.479425538604203 * 0.5084065509313012 % 0.5368227193939613 * 0.5646424733950354 * 0.5918349049587529 * 0.618369803069737 ~ 0.644217687237691 * 0.6693498402504662 * 0.6937383400791204 * 0.7173560908995228 % 0.7401768531960371 * 0.7621752729138397 % 0.7833269096274834 * 0.8036082636944112 ~ 0.8229968023632527 * 0.8414709848078965 * 0.8590102860595255 * 0.8755952198100255 % 0.8912073600614354 * 0.9058293615973811 * 0.9194449792537551 * 0.9320390859672263 ~ 0.9435976895815331 * 0.9541079483928832 * 0.963558185417193 * 0.9719379013633127 % 0.9792377862978257 * 0.9854497299884601 % 0.9905668309146253 * 0.9945834039350564 ~ 0.9974949866040544 * 0.9992983441292993 * 0.9999914729657311 * 0.9995736030415051 % 0.9980451986135482 * 0.9954079577517649 * 0.9916648104524686 * 0.9868199153831307 ~ 0.9808786552620674 * 0.9738476308781951 * 0.9657346537574998 * 0.9565487374843666 % 0.9463000876874145 * 0.9350000907009578 % 0.9226613009146958 * 0.9092974268256817 ~ 0.8949233158080702 * 0.8795549376175618 * 0.8632093666488737 * log@breadcube:~/public_html/week8$ python3 thermalprint2.py 1.0 % 1.247403959254523 * 1.479425538604203 * 1.681638760023334 * 1.8414709848078965 ~ 1.9489846193555862 * 1.9974949866040546 * 1.983985946873937 * 1.9092974268256817 % 1.778073196887921 * 1.5984721441039564 % 1.3816609920523317 * 1.1411200080598671 ~ 0.8918048654698916 * 0.6492167723103801 * 0.4284386812576563 * 0.2431975046920718 % 0.1050106417714165 * 0.02246988233490299 * 0.000707211024622012 * 0.041075725336861546 ~ 0.141065506573408 * 0.2944596744296081 * 0.4917209225007416 * 0.7205845018010741 % 0.9668207834524432 * 1.2151199880878156 % 1.4500440737806177 * 1.656986598718789 ~ 1.8230808790115054 * 1.937999976774739 * 1.9945987791111761 * 1.989358246623382 % 1.9226042102393404 * 1.7984871126234903 * 1.6247239537541924 * 1.4121184852417565 ~ 1.1738894853804336 * 0.9248488795381907 * 0.6804808063777263 * 0.4559788891106302 % 0.26530156959520457 * 0.12030424002832996 % 0.030002132079321453 * 9.793449296524592e-06 ~ 0.03219200248873855 * 0.12454782531157149 * 0.27133502417282995 * 0.46342708199956506 % 0.6888806450188727 * 0.9336781026487994 * 1.182599134631134 * 1.420167036826641 ~ 1.6316109877182385 * 1.803784426551621 * 1.9259824428086272 * 1.9906073556948702 % 1.9936411011327626 * 1.934895055524683 % 1.818021763454694 * 1.6502878401571168 ~ 1.4421221685765393 * 1.2064674819377965 * 0.9579756472811592 * log@breadcube:~/public_html/week8$ python3 thermalprint2.py 1.0 % 1.247403959254523 * 1.479425538604203 * 1.681638760023334 * 1.8414709848078965 ~ 1.9489846193555862 * 1.9974949866040546 * 1.983985946873937 * 1.9092974268256817 % 1.778073196887921 * 1.5984721441039564 % 1.3816609920523317 * 1.1411200080598671 ~ 0.8918048654698916 * 0.6492167723103801 * 0.4284386812576563 * 0.2431975046920718 % 0.1050106417714165 * 0.02246988233490299 * 0.000707211024622012 * 0.041075725336861546 ~ 0.141065506573408 * 0.2944596744296081 * 0.4917209225007416 * 0.7205845018010741 % 0.9668207834524432 * 1.2151199880878156 % 1.4500440737806177 * 1.656986598718789 ~ 1.8230808790115054 * 1.937999976774739 * 1.9945987791111761 * 1.989358246623382 % 1.9226042102393404 * 1.7984871126234903 * 1.6247239537541924 * 1.4121184852417565 ~ 1.1738894853804336 * 0.9248488795381907 * 0.6804808063777263 * 0.4559788891106302 % 0.26530156959520457 * 0.12030424002832996 % 0.030002132079321453 * 9.793449296524592e-06 ~ 0.03219200248873855 * 0.12454782531157149 * 0.27133502417282995 * 0.46342708199956506 % 0.6888806450188727 * 0.9336781026487994 * 1.182599134631134 * 1.420167036826641 ~ 1.6316109877182385 * 1.803784426551621 * 1.9259824428086272 * 1.9906073556948702 % 1.9936411011327626 * 1.934895055524683 % 1.818021763454694 * 1.6502878401571168 ~ 1.4421221685765393 * 1.2064674819377965 * 0.9579756472811592 * log@breadcube:~/public_html/week8$ python3 thermalprint2.py % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * log@breadcube:~/public_html/week8$ python3 thermalprint2.py % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * log@breadcube:~/public_html/week8$ python3 thermalprint2.py % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * log@breadcube:~/public_html/week8$ python3 thermalprint2.py % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * log@breadcube:~/public_html/week8$ python3 thermalprint2.py % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * log@breadcube:~/public_html/week8$ python3 thermalprint2.py % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * log@breadcube:~/public_html/week8$ python3 thermalprint2.py % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * * % * * * ~ * * * % * % * ~ * * log@breadcube:~/public_html/week8$
At this point the script was like:
from escpos.printer import File import time import os import math printername = "/dev/usb/lp1" printerwidth = 64 wavelength = 10 for i in range(0,64): # os.system('echo "' + str(i) + '" > /dev/usb/lp0') # iprinter.text(str(i)) pos = 1+math.sin(i/wavelength) # print(pos) if (i%8 == 0) or (i%16 == 10): print(" "*int(pos*printerwidth) + "%") # os.system('echo "' + " "*int(pos*printerwidth) + '%" > ' + printer0name) elif i%8 == 4: print(" "*int(pos*printerwidth) + "~") # os.system('echo "' + " "*int(pos*printerwidth) + '~" > '+ printer0name) else: print(" "*int(pos*printerwidth) + "*") # os.system('echo "' + " "*int(pos*printerwidth) + '*" > '+ printer0name) time.sleep(0.125) # iprinter.close()
So uncomment the lines and then