I am starting simple. I eventually want to design a program to run the stepper motors and laser to do an engraving. I wrote a Python script, but nothing happens at the machine. Running the script gets me this display that stays until I CTRL+Z:
init MegaPi
<megapi.mSerial instance at 0x766caa58>
I first was getting [Errno 25] Inappropriate ioctl for device>>>, until I found to disable bluetooth. I added this to /boot/config.txt:
dtoverlay=pi3-disable-bt
When plugged into USB, I can see the device in the list when using LSUSB:
Bus 001 Device 005: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
My simple script:
from megapi import *
if name == ‘main’:
bot = MegaPi()
bot.start()
#bot.start()
bot.stepperStop(1);
sleep(1);
while 1:
sleep(1);
bot.stepperRun(1,600);
sleep(2);
bot.stepperRun(1,100);
sleep(2);
bot.stepperStop(1);
sleep(1);
bot.stepperRun(1,-600);
sleep(2);
bot.stepperRun(1,-100);
sleep(2);
bot.stepperStop(1);