Skip to content

Instantly share code, notes, and snippets.

@Ludorg
Last active May 4, 2021 01:55
Show Gist options
  • Save Ludorg/9c7827068816e4528bcd006f84aaa43d to your computer and use it in GitHub Desktop.
Save Ludorg/9c7827068816e4528bcd006f84aaa43d to your computer and use it in GitHub Desktop.
Simple use of L298N Motor driver with two BBC micro:bit (1 for Motor Control, 1 for Remote Controler )

Simple use of L298N Motor driver with two BBC micro:bit (1 for Motor Control, 1 for Remote Controller )

Twitter Follow

Requirements

Hardware

  • 2 BBC micro:bit (see store)
  • 1 Motor Drive Controller L298N (I bought mine on Amazon.fr)
  • 1 ZK-2 Wheel-Drive Plastic Chassis bought from Kubii
  • 1 Pin:Bit connector
  • 1 small breadboard

Software

Assembly

  1. Assemble and mount ZK-2 chassis (see video tutorial)
  2. Connect micro:bit P0 to IN1 and IN3 of L298N and P1 to IN2 and IN4 of L298N
  3. Connect +6V (4*1.5V) from batteries to micro:bit power supply and to the two voltage inputs of L298N
  4. Connect 0V to micro:bit and L298N GND inputs

Example of assembly

Installation

Download binary with MakeCode or via direct copy on both BBC micro:bit. One is the remote controller, the other the motor controller.

Usage

On the remote or on the motor control, pushing A button moves the car in a direction. Pushing B button moves in the opposite direction. Pushing A+B stop the movement.

Contact

If you want to contact me, you can reach me at ludorg@ludorg.net.

License

This project uses the MIT license.

MIT License

Copyright (c) 2020 Ludovic LIEVRE aka Ludorg

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment