Skip to content

Python script initializes Arduino code (3D_Printer_controller.ino) line by line #9

@Inkyu-Oh

Description

@Inkyu-Oh

During my testing with Oliver last week, any Python command with negative values as below didn't work such as...
motor = controller.Motor()
motor.send(b'<X,1000,-2000>')

I have been suspicious about this binary string can't hold negative integers, but now I guess there is another reason.

Whenever Python command was executed line by line, Nikita's Arduino code was initialized with every single Python command. However, Nikita’s code first executes homing (if not commentized) and set the (0,0) position, and then track the number (I guess 0 to 20,000 is admissible tracking numbers, and we can add or subtract any positive or negative intergers so that these tracking numbers are within this admissible range). That’s why we couldn’t execute for example “motor.send(b'<X,1000,+2000>')” and then “motor.send(b'<X,1000,-2000>')” in Python. The head will first go right, but as Arduino code initializes again, the tracking number becomes zero then we can not make -2000 with the second Python command.

Therefore, Python controller module should be fixed so that it doesn’t initialize Arduino code with every Python command line. I am quite sure about this reasoning. When I decommentize homing() in Aduino code, and run some python scripts, homing was executed with every python line commands. This means that python makes Arduino code run from the beginning everytime.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions