Code Monkey home page Code Monkey logo

ramps's Introduction

Ramps Library

Welcome GitHub repository of my school project!

This is my Library for the Ramps 1.4 shield. The annotations are currently in Dutch, but I'm prepared to translate it all if there is enough demand.

Functions

Ramps.h

these are the fuctions a Ramps object can do:

  • Create a ramps object:

    Ramps ramps = Ramps();
    
  • Home the X, Y and Z axes:

    ramps.home();
    
  • Move to a position in a straight line:

    ramps.moveTo(targetX, TargetY, TargetZ, delay);
    

    delay is the time between steps in microseconds

  • Turn the the led on or off:

    ramps.led(On);
    

    On is a boolean

  • Turn the fan on or off:

    ramps.fan(On);
    

    On is a boolean

  • Control the heater:

    ramps.heater(heater, value);
    

    heater says which heater: Either 0 for heater_0 or 1 for heater_1.

    value is a byte that says how hot (PWM controlled)

  • The PololuDriver objects:

    ramps.motorX
    ramps.motorY
    ramps.motorZ
    ramps.motorE
    ramps.motorQ
    

    These are created by the Ramps library and can be directly controlled with the commands of the PololuDriver.h library. An example:

    ramps.motorX.stepOn();
    
    delayMicroseconds(500);
    
    ramps.motorX.stepOff();
    

PololuDriver.h

The pololuDriver.h library can be used for derect control of a pololu A4988 driver or a DRV8825

  • Create a PololuDriver object:

    pololuStepper motor = pololuStepper(stepPin, dirPin, enablePin);
    

    the stepPin, dirPin and enablePin are the connections to the driver.

  • Set the direction:

    motor.setDir(direction);
    

    The direction is either 1 (DIR is LOW) or -1 (DIR is HIGH)

  • Manual stepping

    These two functions are used together for manual stepping.

    1. stepOn is to make the motor step

      motor.stepOn();
      

      the moment you call stepOn, the motor will step and the position will be updated. if everything is handled correctly, it will return a boolean.

    2. stepOff is for finishing the step.

    motor.stepOff();
    

    stepOff has to be called after stepOn and with a delay inbetween:

    motor.stepOn();
    delayMicroseconds(500);
    motor.stepOff();
    

    If stepOff isn't called after stepOn and you call stepOn agian, the motor won't step, position won't be updated and stepOn will return false!

  • Move a number of steps

    motor.autoStep(amount, delay);
    

    Move the amount of steps with a delay in microseconds in between each step.

  • Move to a position

    motor.moveTo(targetPos, delay);
    

    Move to the target position with a delay in microseconds in between each step.

ramps's People

Contributors

momostein avatar

Stargazers

Ryan Du avatar  avatar Szymon Stasiak avatar Ondřej Vaculík avatar Wesley Eenjes avatar Miguel avatar MatMat81 avatar  avatar Matt Johnson avatar Ethan Merrill avatar Naoto Hieda avatar Pedro Leme avatar Nikita Vladimirov avatar

Watchers

MatMat81 avatar  avatar

ramps's Issues

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.