Please do not give solution in image format thanku convert this into pybricks : from project import motor from project import sensor from project import variables def feed_in(): """This will feed the paper in until it covers the light sensor. This should be done before printing anything. """ while True: motor['B'].on(-50) if sensor['4'].read_reflected() > 4: break motor['B'].off() def feed_out(): """Call when you are finished printing to feed the paper out.""" while True: motor['B'].on(50) if sensor['4'].read_reflected() < 2: break motor['B'].off() motor['B'].on_for_degrees(50, 600) def lift_pen(): """Lifts the pen off the page so that it can be moved without depositing ink. """ motor['C'].on_for_degrees(25, 180) def line_feed(): """Feed the paper in by the height of one line, plus the line spacing, which should really be specified as a variable in the 'Initialize' MyBlock. """ motor['B'].on_for_degrees(-20, variables['Seg4']) motor['B'].on_for_degrees(-20, 20) def lower_pen(): """Lowers the pen on the page so that it will deposit ink when it is moved. """ motor['C'].on_for_degrees(25, -180)
Please do not give solution in image format thanku
convert this into pybricks :
from project import motor
from project import sensor
from project import variables
def feed_in():
"""This will feed the paper in until it covers the light sensor. This
should be done before printing anything.
"""
while True:
motor['B'].on(-50)
if sensor['4'].read_reflected() > 4:
break
motor['B'].off()
def feed_out():
"""Call when you are finished printing to feed the paper out."""
while True:
motor['B'].on(50)
if sensor['4'].read_reflected() < 2:
break
motor['B'].off()
motor['B'].on_for_degrees(50, 600)
def lift_pen():
"""Lifts the pen off the page so that it can be moved without depositing
ink.
"""
motor['C'].on_for_degrees(25, 180)
def line_feed():
"""Feed the paper in by the height of one line, plus the line spacing,
which should really be specified as a variable in the 'Initialize' MyBlock.
"""
motor['B'].on_for_degrees(-20, variables['Seg4'])
motor['B'].on_for_degrees(-20, 20)
def lower_pen():
"""Lowers the pen on the page so that it will deposit ink when it is moved.
"""
motor['C'].on_for_degrees(25, -180)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Introductory Circuit Analysis (13th Edition)](https://www.bartleby.com/isbn_cover_images/9780133923605/9780133923605_smallCoverImage.gif)
![Delmar's Standard Textbook Of Electricity](https://www.bartleby.com/isbn_cover_images/9781337900348/9781337900348_smallCoverImage.jpg)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
![Introductory Circuit Analysis (13th Edition)](https://www.bartleby.com/isbn_cover_images/9780133923605/9780133923605_smallCoverImage.gif)
![Delmar's Standard Textbook Of Electricity](https://www.bartleby.com/isbn_cover_images/9781337900348/9781337900348_smallCoverImage.jpg)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
![Fundamentals of Electric Circuits](https://www.bartleby.com/isbn_cover_images/9780078028229/9780078028229_smallCoverImage.gif)
![Electric Circuits. (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780134746968/9780134746968_smallCoverImage.gif)
![Engineering Electromagnetics](https://www.bartleby.com/isbn_cover_images/9780078028151/9780078028151_smallCoverImage.gif)