Introduction: Arduino Nano and Visuino: Control 2 Stepper Motors With Joystick

When building Arduino projects with Stepper motors, such as CNC machine, plotter, or Animated Art, there comes a moment when the steppers need to be controlled manually. Analog Joysticks are cheap and easy modules for manual control, with variable speed. They seem to be a good choice to control the steppers. Solving the problem with traditional Arduino code however is not trivial.

In this Instructable, I will show you how easy it is to program Arduino Nano with Visuino to control 2 stepper motors with Joystick.

Step 1: Components

  1. One Arduino compatible board (I use Arduino Nano, because I have one, but any other will be just fine)
  2. One Joystick that I got from this cheap 37 sensors set
  3. Two 5V Stepper Motors with Driver Boards (I used 28BYJ-48 stepper with ULN2003 driver board )
  4. One K2 Breadboard power supply with adapter (Picture 2), or other 5V Power source for the Steppers
  5. 17 Female-Female jumper wires

Step 2: Connect Power and Ground the Stepper Motors

  1. Connect Ground(Black wire), and Power(Red wire), to each of the Stepper Driver modules (Picture 1)
  2. Connect another Ground(Black wire) to Ground pin of the Arduino board (Picture 2)
  3. Connect the other end of the Power (Red wires) from the Motor Driver modules to the "+" Power pins of the K2 Power supply (Pictures 3, and 4)
  4. Connect the other end of the Ground (Black wires) from the Motor Driver modules, and the Arduino to the "-" Ground pins of the K2 Power supply (Pictures 3, and 4)
  5. Make sure the Power Selection Switch of the K2 power supply is set to 5V (Picture 5)
  6. Picture 6 shows where is the Ground pin of the Arduino Nano

Step 3: Connect the Stepper Motors to the Arduino

  1. If not already connected, plug the Stepper Motor connectors into the Driver Boards
  2. Connect one end of Female-Female jumper wires (Blue, Green, Yellow and Orange wires) to the IN1 to IN4pins of the Stepper Driver for the First Motor (Picture 1)
  3. Connect one end of Female-Female jumper wires (Blue, Green, Yellow and Orange wires) to the IN1 to IN4pins of the Stepper Driver for the Second Motor (Picture 1)
  4. Connect the IN1 wire from the First Motor (Blue wire) to the Digital pin 2 of the Arduino board (Picture 2)
  5. Connect the IN2 wire from the First Motor (Green wire) to the Digital pin 3 of the Arduino board (Picture 2)
  6. Connect the IN3 wire from the First Motor (Yellow wire) to the Digital pin 4 of the Arduino board (Picture 2)
  7. Connect the IN4 wire from the First Motor (Orange wire) to the Digital pin 5 of the Arduino board (Picture 2)
  8. Connect the IN1 wire from the Second Motor (Blue wire) to the Digital pin 6 of the Arduino board (Picture 3)
  9. Connect the IN2 wire from the Second Motor (Green wire) to the Digital pin 7 of the Arduino board (Picture 3)
  10. Connect the IN3 wire from the Second Motor (Yellow wire) to the Digital pin 8 of the Arduino board (Picture 3)
  11. Connect the IN4 wire from the Second Motor (Orange wire) to the Digital pin 9 of the Arduino board (Picture 3)
  12. Picture 4 shows in Red where are the Digital 2 to Digital 9 pins of the Arduino Nano . In Blue is shown the connection done in the previous step

Step 4: Connect the Joystick to the Arduino

  1. Connect Female-Female wires to the Ground(Black wire), Power(Red wire), VRx(Purple wire), and VRy(Gray wire) of the Joystick as shown in Picture 1
  2. Connect the Ground wire(Black wire) to the Ground pin of the Arduino board (Picture 2)
  3. Connect the Power wire(Red wire) to the 5V Power pin of the Arduino (Picture 2)
  4. Connect the VRx wire(Brown wire) the the Analog 1 pin of the Arduino board (Picture 3)
  5. Connect the VRy wire(Gray wire) the the Analog 0 pin of the Arduino board (Picture 3)
  6. Picture 4 shows in Red where are the Ground, 5V Power, Analog 0, and Analog 1 pins of the Arduino Nano . In Blue is shown the connection done in the previous steps

Step 5: Start Visuino, and Select the Arduino Board Type

To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc/ .

Please be aware that there are some critical bugs in Arduino IDE 1.6.6.

Make sure that you install 1.6.7 higher, otherwise this Instructable will not work!

The Visuino: https://www.visuino.com also needs to be installed.

  1. Start Visuino as shown in the first picture
  2. Click on the "Tools" button on the Arduino component (Picture 1) in Visuino
  3. When the dialog appears, select Arduino Nano as shown in Picture 2

Step 6: In Visuino: Add and Connect Stepper Motor Components

First we need to add components to control the stepper motors:

  1. Type "step" in the Filter box of the Component Toolbox then select the "4 Wire Stepper Motor" component (Picture 1), and drop two of them it in the design area
  2. Click in the "Out" box containing the pins of the Stepper1 component to start connecting all the Out pins at once (Picture 2)
  3. Move the mouse over the "Digital" input pin of the "Digital[ 2 ]" channel of the Arduino component. The Visuino will automatically spread the wires so they will connect correctly to the rest of the pins (Picture 2)
  4. Click in the "Out" box containing the pins of the Stepper2 component to start connecting all the Out pins at once (Picture 3)
  5. Move the mouse over the "Digital" input pin of the "Digital[ 6 ]" channel of the Arduino component. The Visuino will automatically spread the wires so they will connect correctly to the rest of the pins (Picture 3)

Step 7: In Visuino: Set the Stepper Motor Component Properties, and Add Pins to Control the Speed

Since we want to control the speed of the steppers, we need to add pins to the "Steps Per Second" property:

  1. Select the Stepper1 component (Picture 1)
  2. In the Object Inspector, set the value of the "Steps Per Second" property to "0" (Picture 1)
  3. In the Object Inspector click on the Pin button at front of the "Steps Per Second" property, and select "Float SinkPin" (Picture 2)
  4. Select the Stepper2 component (Picture 3)
  5. In the Object Inspector, set the value of the "Steps Per Second" property to "0" (Picture 3)
  6. In the Object Inspector click on the Pin button at front of the "Steps Per Second" property, and select "Float SinkPin" (Picture 4)

Step 8: In Visuino: Add and Connect Dead Zone Scaled Analog Components

The Analog Pins where the Joystick is connected generate normalized values between 0.0 and 1.0. We need to convert them to +/-300 steps per second. Since the Joystick is not very precise when in released center position, we want a small zone around the center to be considered 0.5 so we need to introduce "Dead Zone":

  1. Type "zone" in the Filter box of the Component Toolbox then select the "Dead Zone Scaled Analog" component (Picture 1), and drop two of them it in the design area
  2. Connect the "Out" output pin of the DeadZoneScaled1 component to the "StepsPerSecond" input pin of the Stepper1 component (Picture 2)
  3. Connect the "Out" output pin of the "Digital[ 14 ]/Analog[ 0 ]" channel of the Arduino component to the "In" input pin of the DeadZoneScaled1 component (Picture 3)
  4. Connect the "Out" output pin of the DeadZoneScaled2 component to the "StepsPerSecond" input pin of the Stepper2 component (Picture 4)
  5. Connect the "Out" output pin of the "Digital[ 15 ]/Analog[ 1 ]" channel of the Arduino component to the "In" input pin of the DeadZoneScaled2 component (Picture 5)

Step 9: In Visuino: Set the Properties of the Dead Zone Scaled Analog Components

  1. In the Design Area, select the DeadZoneScaled1 component (Picture 1)
  2. In the Object Inspector, expand the "Output Range" property (Picture 1)
  3. In the Object Inspector, set the value of the "Max" sub-property of the "Output Range" property to "300" (Picture 1)
  4. In the Object Inspector, set the value of the "Min" sub-property of the "Output Range" property to "-300" (Picture 2)
  5. In the Design Area, select the DeadZoneScaled2 component (Picture 3)
  6. In the Object Inspector, expand the "Output Range" property (Picture 3)
  7. In the Object Inspector, set the value of the "Max" sub-property of the "Output Range" property to "300" (Picture 3)
  8. In the Object Inspector, set the value of the "Min" sub-property of the "Output Range" property to "-300" (Picture 4)

Step 10: Generate, Compile, and Upload the Arduino Code

  1. In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
  2. In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)

Step 11: And Play...

Congratulations! You have completed the project.

Picture 1 and the Video show the connected and powered up project.

You can control the Steppers with the Joystick as seen the Video. Moving the Joystick Up and Down will control the Forward and Backward rotation of one of the Steppers. Moving the Joystick Left and Right will control the other Stepper.

On Picture 2 you can see the complete Visuino diagram.

Also attached is the Visuino project, that I created for this Instructable. You can download and open it in Visuino: https://www.visuino.com

Comments

author
RossMackay1974 made it!(author)2017-07-13

These are the error logs I am getting on compile.

Arduino: 1.8.3 (Windows 10), Board: "Arduino/Genuino Uno"

D:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\Program Files (x86)\Arduino\hardware -tools D:\Program Files (x86)\Arduino\tools-builder -tools D:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries D:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Ross Mackay\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path C:\Users\ROSSMA~1\AppData\Local\Temp\arduino_build_426257 -warnings=none -build-cache C:\Users\ROSSMA~1\AppData\Local\Temp\arduino_cache_570334 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino

D:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware D:\Program Files (x86)\Arduino\hardware -tools D:\Program Files (x86)\Arduino\tools-builder -tools D:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries D:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Ross Mackay\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path C:\Users\ROSSMA~1\AppData\Local\Temp\arduino_build_426257 -warnings=none -build-cache C:\Users\ROSSMA~1\AppData\Local\Temp\arduino_cache_570334 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino

Using board 'uno' from platform in folder: D:\Program Files (x86)\Arduino\hardware\arduino\avr

Using core 'arduino' from platform in folder: D:\Program Files (x86)\Arduino\hardware\arduino\avr

Detecting libraries used...

"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\ROSSMA~1\AppData\Local\Temp\arduino_build_426257\sketch\Generated.ino.cpp" -o "nul"

"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835" "C:\Users\ROSSMA~1\AppData\Local\Temp\arduino_build_426257\sketch\Generated.ino.cpp" -o "nul"

Generating function prototypes...

"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835" "C:\Users\ROSSMA~1\AppData\Local\Temp\arduino_build_426257\sketch\Generated.ino.cpp" -o "C:\Users\ROSSMA~1\AppData\Local\Temp\arduino_build_426257\preproc\ctags_target_for_gcc_minus_e.cpp"

"D:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\ROSSMA~1\AppData\Local\Temp\arduino_build_426257\preproc\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835" "C:\Users\ROSSMA~1\AppData\Local\Temp\arduino_build_426257\sketch\Generated.ino.cpp" -o "C:\Users\ROSSMA~1\AppData\Local\Temp\arduino_build_426257\sketch\Generated.ino.cpp.o"

Generated:25: error: no matching function for call to 'Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int)'

Mitov::ArduinoDigitalInputChannel ArduinoDigitalChannel_2( 2 );

^

C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:25:62: note: candidates are:

In file included from C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:16:0:

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int, bool)

ArduinoDigitalInputChannel( int APinNumber, bool AIsOpenDrain )

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: candidate expects 2 arguments, 1 provided

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(const Mitov::ArduinoDigitalInputChannel&)

class ArduinoDigitalInputChannel

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'const Mitov::ArduinoDigitalInputChannel&'

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(Mitov::ArduinoDigitalInputChannel&&)

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'Mitov::ArduinoDigitalInputChannel&&'

Generated:26: error: no matching function for call to 'Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int)'

Mitov::ArduinoDigitalInputChannel ArduinoDigitalChannel_3( 3 );

^

C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:26:62: note: candidates are:

In file included from C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:16:0:

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int, bool)

ArduinoDigitalInputChannel( int APinNumber, bool AIsOpenDrain )

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: candidate expects 2 arguments, 1 provided

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(const Mitov::ArduinoDigitalInputChannel&)

class ArduinoDigitalInputChannel

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'const Mitov::ArduinoDigitalInputChannel&'

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(Mitov::ArduinoDigitalInputChannel&&)

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'Mitov::ArduinoDigitalInputChannel&&'

Generated:27: error: no matching function for call to 'Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int)'

Mitov::ArduinoDigitalInputChannel ArduinoDigitalChannel_4( 4 );

^

C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:27:62: note: candidates are:

In file included from C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:16:0:

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int, bool)

ArduinoDigitalInputChannel( int APinNumber, bool AIsOpenDrain )

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: candidate expects 2 arguments, 1 provided

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(const Mitov::ArduinoDigitalInputChannel&)

class ArduinoDigitalInputChannel

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'const Mitov::ArduinoDigitalInputChannel&'

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(Mitov::ArduinoDigitalInputChannel&&)

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'Mitov::ArduinoDigitalInputChannel&&'

Generated:28: error: no matching function for call to 'Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int)'

Mitov::ArduinoDigitalInputChannel ArduinoDigitalChannel_5( 5 );

^

C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:28:62: note: candidates are:

In file included from C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:16:0:

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int, bool)

ArduinoDigitalInputChannel( int APinNumber, bool AIsOpenDrain )

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: candidate expects 2 arguments, 1 provided

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(const Mitov::ArduinoDigitalInputChannel&)

class ArduinoDigitalInputChannel

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'const Mitov::ArduinoDigitalInputChannel&'

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(Mitov::ArduinoDigitalInputChannel&&)

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'Mitov::ArduinoDigitalInputChannel&&'

Generated:29: error: no matching function for call to 'Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int)'

Mitov::ArduinoDigitalInputChannel ArduinoDigitalChannel_6( 6 );

^

C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:29:62: note: candidates are:

In file included from C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:16:0:

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int, bool)

ArduinoDigitalInputChannel( int APinNumber, bool AIsOpenDrain )

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: candidate expects 2 arguments, 1 provided

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(const Mitov::ArduinoDigitalInputChannel&)

class ArduinoDigitalInputChannel

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'const Mitov::ArduinoDigitalInputChannel&'

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(Mitov::ArduinoDigitalInputChannel&&)

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'Mitov::ArduinoDigitalInputChannel&&'

Generated:30: error: no matching function for call to 'Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int)'

Mitov::ArduinoDigitalInputChannel ArduinoDigitalChannel_7( 7 );

^

C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:30:62: note: candidates are:

In file included from C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:16:0:

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int, bool)

ArduinoDigitalInputChannel( int APinNumber, bool AIsOpenDrain )

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: candidate expects 2 arguments, 1 provided

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(const Mitov::ArduinoDigitalInputChannel&)

class ArduinoDigitalInputChannel

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'const Mitov::ArduinoDigitalInputChannel&'

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(Mitov::ArduinoDigitalInputChannel&&)

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'Mitov::ArduinoDigitalInputChannel&&'

Generated:31: error: no matching function for call to 'Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int)'

Mitov::ArduinoDigitalInputChannel ArduinoDigitalChannel_8( 8 );

^

C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:31:62: note: candidates are:

In file included from C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:16:0:

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int, bool)

ArduinoDigitalInputChannel( int APinNumber, bool AIsOpenDrain )

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: candidate expects 2 arguments, 1 provided

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(const Mitov::ArduinoDigitalInputChannel&)

class ArduinoDigitalInputChannel

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'const Mitov::ArduinoDigitalInputChannel&'

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(Mitov::ArduinoDigitalInputChannel&&)

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'Mitov::ArduinoDigitalInputChannel&&'

Generated:32: error: no matching function for call to 'Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int)'

Mitov::ArduinoDigitalInputChannel ArduinoDigitalChannel_9( 9 );

^

C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:32:62: note: candidates are:

In file included from C:\Users\Ross Mackay\Documents\Visuino\Generated\Generated.ino:16:0:

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int, bool)

ArduinoDigitalInputChannel( int APinNumber, bool AIsOpenDrain )

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2122:3: note: candidate expects 2 arguments, 1 provided

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(const Mitov::ArduinoDigitalInputChannel&)

class ArduinoDigitalInputChannel

^

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'const Mitov::ArduinoDigitalInputChannel&'

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: constexpr Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(Mitov::ArduinoDigitalInputChannel&&)

C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835/Mitov.h:2092:11: note: no known conversion for argument 1 from 'int' to 'Mitov::ArduinoDigitalInputChannel&&'

Using library mitov-visuino-libraries-d5c929c8c835 in folder: C:\Users\Ross Mackay\Documents\Arduino\libraries\mitov-visuino-libraries-d5c929c8c835 (legacy)

exit status 1

no matching function for call to 'Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int)'

author
BoianM made it!(author)2017-07-13

What version of Visuino you used? It seems like you have wrong version of the libraries on first glance.

author
RossMackay1974 made it!(author)2017-07-13

Thank for the response, I am using version 7.8.2.142. The library file it seems to be complaining about is:

no matching function for call to 'Mitov::ArduinoDigitalInputChannel::ArduinoDigitalInputChannel(int)'

When I look in the library there are no files described as ArduinoDigitalInputChannel

author
RossMackay1974 made it!(author)2017-07-13

OK, new version installed and it compiles just fine. Must have been the library files incompatibility with an older version of Visuino/Arduino.

So the Y axis motor turns fine, perfect, but the x axis just follows it regardless of any X axis movement. Any idea what could be causing this? I'm checking the wiring just now but I can't see anything wrong, seems weird that they are both just following each other.

author
RossMackay1974 made it!(author)2017-07-13

Ok, not wiring, but connections. I had Analog 1 & 2 defined instead of Analog 0 & 1. So it works! Now to look at bigger motors.

author
BoianM made it!(author)2017-07-13

ArduinoDigitalInputChannel is in Mitov.h

I suspect that you have older version of the library in a different folder :-(

author
RossMackay1974 made it!(author)2017-07-13

This is exactly what I was looking for. Where do I get the libraries that are required for successful compilation?

author
BoianM made it!(author)2017-07-13

The latest libraries are here:
https://bitbucket.org/mitov/visuino-libraries

However they are compatible with the latest version of Visuino.
It is best to download the Visuino and use it for free to generate the Arduino code. The Install also install the necessary libraries :-)

author
RossMackay1974 made it!(author)2017-07-13

I will look and see if there is a new version, thanks.

author
WASANHA made it!(author)2017-07-12

dear sir my name is wasantha

can you please be kind enough to send me the arduino code

thanks

author
BoianM made it!(author)2017-07-13

Download and use Visuino for free to generate the Arduino code. This will make sure you have the correct version of the libraries for the generated code.
Visuino runs free for 10 minutes every time you start it, so you have plenty of time to generate the code, and even do the whole project from scratch... ;-)

author
nerd_at_work made it!(author)2017-01-06

it is not a very clear picture, but I changed my couch into a workbench...

temp_1394227123.jpg
author
BoianM made it!(author)2017-01-06

Looks nice :-) Congratulations! Enjoy :-)

author
nerd_at_work made it!(author)2016-12-27

This is exactly the instructable that I needed for my project, thank you so much!

author
BoianM made it!(author)2016-12-27

You are Welcome! Enjoy :-)

author
nerd_at_work made it!(author)2016-12-28

Okay I did everything according to your instructions, I used your attached visuino project, but somehow my stepper motors keep on turning clockwise, and the joystick seems not to work, albeit that a full left deflection of the stick makes the "Tx"light on my arduino lits up. I'm using an Uno board by the way.

author
nerd_at_work made it!(author)2017-01-05

Nevermind, I forgot to connect the GND from the external power supply to the arduino....

It works!!

author
BoianM made it!(author)2017-01-05

Great! :-) I am glad you found the bug :-) . Post some picture ;-) . You can click on the "I Made it!" button and post the picture :-) Will be nice to see it :-)

author
CristianT15 made it!(author)2016-08-02

Hello,

This is amazing! I made it and i am really happy about it! I've been trying to do the same thing but without Visuino, and also by adding a LCD (using the analog pins A2-A7 as digital outputs) to indicate the "position" of the steppers, and the joystick push button to change the speeds of the stepper.

Thank you for this instructable, it will really help me out to achieve my goal!

instructable.jpg
author
cooltrax made it!(author)2016-11-08

Hi, do you have the code for it?

author
CristianT15 made it!(author)2016-11-08

Sorry, my computer's hard drive broke and i lost everything.

author
cooltrax made it!(author)2016-11-07

How far have you got with the lcd display, would love to see the code and circuit.

author
CristianT15 made it!(author)2016-11-07

Unfortunately, my computer's hard drive failed, so i lost everything (before i could finish the code). But the logic i had was to have a counter, and every time the stepper made one step (CW), the counter would increase, and if it went counter clock-wise, it would decrease by one. The problem with that was that sometimes these cheap steppers would not turn (because too much torque would prevent it from turning), but the counter would still update.

author
grayl made it!(author)2016-09-22

My point was, having decided to build the device with the help of Visuino, how does one come to know that something called DeadZoneScaledAnalog has anything to do with a Joy Stick? I was looking through the items from which one can select a component on the right side of the Visuino screen and I could not find any reference to a joy stick. It seems to me that without the help of Boian, I quickly arrives at a dead end.

author
BoianM made it!(author)2016-09-22

Well... as I pointed, the Dead Zone is one of hundreds of components that can be used with Joystick ;-) . very much any analog component is a good candidate for this, and it depends on the desired functionality. That being said, I am constantly looking for ways to improve the Visuino and its components, and I will try to make it easier to use. I will see if I can come up with some ideas ;-)

author
BoianM made it!(author)2016-08-02

You are Welcome! Enjoy :-)

author
BoianM made it!(author)2016-08-02

You are Welcome! Enjoy :-)

author
grayl made it!(author)2016-09-19

How did we come to know that DeadZoneScaledAnalog had anything to do with a Joystick?

author
BoianM made it!(author)2016-09-21

It is actually explained in Step 8 ;-) . The Deadzone can be used for many purposes, not only with Joystick. When used with the joystick, it allows the joystick movements around the neutral to be ignored, so if the joystick does not exactly center it will not cause movement by the steppers. The component is optional, but recommended.