Giter Club home page Giter Club logo

micropop32's Introduction

MicroPOP32

Fast, efficient and minimal POP32 library for Line Follower robot.

Installation

This library is mainly developed on PlatformIO, There might be issues with using it on Arduino IDE. Same as POP32, Board must be selected to STM32F103CBT6 if you're using PlatformIO, or POP32 on Arduino IDE.

Usage

Options

// Enable motor function expansion
// Full 4 motors can be used(Default 2)
#define EXTRA_MOTORS
// Disable motor module entirely, saves about 10Kb of flash
#define NO_MOTOR
// Disable detection of OLED_I2C_SSD1309 and proceed without OLED
#define NO_OLED
// Disable the use of extra buttons macro
// Slightly speed up compile time(<1ms), doesn't affect flash size
#define NO_EXTRA_BUTTONS
// Include MUST BE AFTER options define
#include <MicroPOP32.cpp>

Functions

  • m(int id: 1 - 4, int pow: -100 - 100): void
    • Set individual motor's speed.
    • Requires EXTRA_MOTORS.
  • motor(int powl: -100 - 100, int powr: -100 - 100): void
    • Set motor 1 & 2's speed, recommended for robots.
    • Will be disabled if NO_MOTOR is set.
  • ao(): void
    • Stop all motors
    • Requires EXTRA_MOTORS
  • OLED_I2C_SSD1309 oled
    • Pre-initialized OLED Class.
    • Will be disabled if NO_OLED is set or OLED_I2C_SSD1309 is not found.
  • beep(int time = 100): void
    • Turn on the buzzer for time ms.
    • Defaults to 100ms.
  • OK(): void
    • Wait until OK button is pressed.
    • Can be falsy when used too early on startup.
  • EXTRA_ALIASES expansion
    • Creates a short alias for few commonly used functions
    • Doesn't affect flash size
    • a = analogRead
    • d = digitalRead
    • p = pinMode
    • o = digitalWrite
    • b = beep
  • EXTRA_BUTTONS expansion
    • Adds extra button functions
    • Can be disabled with NO_EXTRA_BUTTONS
    • Doesn't affect flash size
    • ok(): bool: Returns true if OK is being pressed
    • sw_A(): bool: Returns true if A is being pressed
    • sw_B(): bool: Returns true if B is being pressed
    • wait_A(): void: Returns once B have been pressed
    • wait_B(): void: Returns once B have been pressed

micropop32's People

Contributors

superdinmc avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.