changed because of naming conflict

Fork of LinearBlend by Bradley Perry

LinearBlend.cpp

Committer:
perr1940
Date:
2015-05-13
Revision:
4:a25456624155
Parent:
3:3503662f78fb

File content as of revision 4:a25456624155:

#include "LinearBlend.h"
#include "mbed.h"

/***********************************************************
Constructor
***********************************************************/
LinearBlend1::LinearBlend1():start(0),slope(0)
{
}

/***********************************************************
Initialize Blend Function
***********************************************************/
//Function that sets the blend global variables to ready for blending calculations.
/*void LinearBlend::init(float end, float s, int t_blend)
{
    slope=(end-s)/t_blend;
    start=s;
}

/***********************************************************
Calculate Blend Function
***********************************************************/
//Function that calculates the blending trajectory, point by point.

/*float* LinearBlend::blend(float ref[])
{
    //Pointer to the variable to store the trajectory point for the left side
    for(int i=0; i<=t_blend; i++) {
        ref[i]=slope*i+start;

    }

    return ref;
}*/

float* LinearBlend1::blend(float end, float s, int t_blend, float ref[])
{
    slope=(end-s)/t_blend;
    //Pointer to the variable to store the trajectory point for the left side
    for(int i=0; i<t_blend; i++) {
        ref[i]=slope*i+s;
    }

    return ref;
}