A PPM driver for the K64F that uses the CMT module

Embed: (wiki syntax)

« Back to documentation index

PPMout Class Reference

PPMout Class Reference

A library for producing PPM output on the K64F (pin PTD7) using the CMT (Carrier/Modulator Transmitter) module. More...

#include <PPMout.h>

Public Member Functions

 PPMout ()
 Create PPMout instance.
void update_channel (int channel, float value)
 Update a PPM channel value.

Detailed Description

A library for producing PPM output on the K64F (pin PTD7) using the CMT (Carrier/Modulator Transmitter) module.

Example:

  #include "mbed.h"
  #include "PPMout.h"

  PPMout myPPM;
  Serial pc(USBTX, USBRX);

  int main()
  {
      while(1) {

          char buffer[128];
          float f;
       
          pc.gets(buffer, 5);
          f = (float) atof(buffer);
      
          myPPM.update_channel(0, f);
      }
  }

Definition at line 82 of file PPMout.h.


Constructor & Destructor Documentation

PPMout (  )

Create PPMout instance.

Definition at line 11 of file PPMout.cpp.


Member Function Documentation

void update_channel ( int  channel,
float  value 
)

Update a PPM channel value.

Parameters:
channelThe channel to update (0-7)
valueThe new value for the channel (0-1)

Definition at line 23 of file PPMout.cpp.