Peristaltic pump SparkFun Qwiic Motor Driver

Hi to all,

does everyone have try to use the sparkfun qwiic motor driver for the dosing pumps? how can I use this board to make it work with mycodo?

Thanks

1 Like

When asking questions about specific hardware, please post a link to that hardware or include as much technical specs about the hardware as possible so people will know exactly what hardware you are referring to without having to waste their time to look it up.

Please read the Mycodo Documentation before posting questions like this.
The Mycodo documentation includes lists of supported hardware for inputs and outputs…

If the hardware you want to use is not listed in the Mycodo Supported Outputs, then you will need to program your own Custom Output module to make it work with Mycodo.

1 Like

Yes, I had looked if it was in the section of the supported outputs, mine was a rhetorical question.
The item is this : Hookup Guide for the Qwiic Motor Driver - SparkFun Learn

qwiic_motor_driver.py (17,2 KB)

ok, I just modified this file from " pump_grove_motor_driver_v1_3.py" .
I have some questions to do:

  • to load the library I need to write the import qwiic_scmd in the initial part of the code or is it necessary to install it in a different mode?

-because I’m using the “scmd library” in the part of the code “class OutputModule(AbstractOutput):” I need to use the variables? of the scmd library ?

-when my code it will be complete I just need to load it in .py format in custom input ?

thanks

1 Like

Any Python library imports that aren’t built-in should occur in initialize().

You will need to modify the output module to use the functions from your new library. You should use the module you’re copying as a rough framework, but all the old library functions will need to be replaced with the analogous functions of your new library.

Yes, but it will be an output, not an input. Be sure to use a unique file name and output_name_unique in the OUTPUT_INFORMATION dictionary, otherwise there will be a conflict with the existing output module when you attempt to import it.

ok next to had follow a python course, and with the help of chatGPT I make this file, but I have an error : “Error: Import Output: Could not load OUTPUT_INFORMATION dictionary from the uploaded output module”. i have checked all the information in the specific section of the code,
and with my basic python level I don’t found any problems. Can you please help me ?

qwiic_motor_driver 2.py (10,9 KB)

I see your dependencies_module format is incorrect. It needs to be a list of tuples, and each tuple needs to contain 3 strings, not two. See other modules that use pypi for examples of how to format it properly.

i2c_location is also incorrectly formatted. It needs to be a list of strings for each I2C address, not a list of a single string of all I2C addresses.

The id in custom_options are also incorrect. They are not using the proper format, which can be found in any of the other modules (Input, Output, Function, Widget).

I would not recommend using chatGPT to generate this file if these simple errors are the result. You are better off looking at other Output modules and modifying it to suit your needs.

1 Like

thank you so much. I use chatGPT because it’s my first time with python, I will try to solve this problems myself.