Table of Contents

run () motor () with () % speed

Description

The block sets the specified motor of the Quarky robot to the specified direction (“FORWARD” or “BACKWARD”) and specified speed.

Example

The example demonstrates how to make the robot go in a circle with different motor speeds.

Script

Output

Read More
Robot Forward
The example demonstrates how the robot move forward, backward, left and right using motor direction control.

Forward

Robot Forward

Backward

Robot Backward

Left

Left Robot

Right

Right Robot

Read More
The example demonstrates how to make a line follower robot with Quarky.

Logic

Script

Alert: You need to calibrate the IR sensor to get the best line detection by the robot. Also, you need to calibrate the speeds to make the robot follow the line correctly.

Output

Read More
interfacing of DC motor with Arduino and it's control.

Motor driver and it’s working

Arduino Uno is a controlling device which is capable to control the things we are connected to it, it is not a power source. motors works on the principle of electromagnetism so draws a lot of load current which can’t be maintained by Arduino, for this we need a motor driver which is integrated circuited (IC) which maintains this load current for the motors.

this is of 16 pin chip among which 2 are enable pins used to control the speed of the motor, 4 for the input pins are 4 for  output pins for the motors, remaining are GND and VCC.

Circuit

connection. 

Arduino uno            Motor driver

D5                             IN1

D4                             IN2

D6                             EN1

GND                          GND

In this example, we will be controlling the direction of rotation of the motor using the motor driver.

code

  • From the actuators palette drag connect motor () direction 1 () direction 2() and PWM()
  • from control palette add forever block

  • From the actuator palette add run motor () in direction () with speed()

  •    from the control palette Add a wait block

  • Repeat the above 2 steps and change the direction from forward to backward

  • Now add when flag clicked event 

Script

OUTPUT

Read More
Learn how to control speed of the motor using Arduino and motor driver.
interfacing motor driver with Arduino

Arduino is a controlling device not a power source on the other hand, motors work on the principle of electromagnetism and hence draw a lot of load current which can’t be maintained by Arduino. To overcome this, we need a motor driver which maintains this load current along with the speed and direction control of the motor.

Circuit

connections

connection. 

Arduino uno            Motor driver

D5                             IN1

D4                             IN2

D6                             EN1

GND                          GND

Code

  • Create a variable as speed and set it 0

  • From actuators drag connect motor () direction 1() direction 2() and PWM()

  • from controls palette add a forever block

  • again from controls palette add if-then-else block in the forever block

  • We will be changing the speed using th up and down arrow. For this goto sensing and check for the key pressed.

  •  from Acturatos add run motor() direction () with speed()

  • Inset the value of the speed variable as motor speed

  • Repeat the above steps for the down arrow to reduce the speed. 

  • Add a wait block for a time of 0.25 seconds in forever block outside the if-then-else block.

  • now from the event palette add when flag clicked event at the start of the script.

Script

Output

Read More
All articles loaded
No more articles to load