This is the final version of Mini Gateway for Automation and Security desgined for Renesas GR Peach Design Contest

Dependencies:   GR-PEACH_video GraphicsFramework HTTPServer R_BSP mbed-rpc mbed-rtos Socket lwip-eth lwip-sys lwip FATFileSystem

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Embed: (wiki syntax)

« Back to documentation index

AnalogOut Class Reference

AnalogOut Class Reference
[Drivers]

An analog output, used for setting the voltage on a pin. More...

#include <AnalogOut.h>

Public Member Functions

 AnalogOut (PinName pin)
 Create an AnalogOut connected to the specified pin.
void write (float value)
 Set the output voltage, specified as a percentage (float)
void write_u16 (unsigned short value)
 Set the output voltage, represented as an unsigned short in the range [0x0, 0xFFFF].
float read ()
 Return the current output voltage setting, measured as a percentage (float)
AnalogOutoperator= (float percent)
 An operator shorthand for write()
 operator float ()
 An operator shorthand for read()

Detailed Description

An analog output, used for setting the voltage on a pin.

Synchronization level: Thread safe

Example:

 // Make a sawtooth output

 #include "mbed.h"

 AnalogOut tri(p18);
 int main() {
     while(1) {
         tri = tri + 0.01;
         wait_us(1);
         if(tri == 1) {
             tri = 0;
         }
     }
 }

Definition at line 52 of file AnalogOut.h.


Constructor & Destructor Documentation

AnalogOut ( PinName  pin )

Create an AnalogOut connected to the specified pin.

Parameters:
AnalogOutpin to connect to (18)

Definition at line 60 of file AnalogOut.h.