You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
659 B
27 lines
659 B
7 years ago
|
#ifndef _PUSHER_H
|
||
|
#define _PUSHER_H
|
||
|
|
||
|
#include <cstdint>
|
||
|
#include "semaphore.h"
|
||
|
|
||
|
static constexpr uint16_t MIN_PULSE_WIDTH = 544; // the shortest pulse sent to a servo
|
||
|
static constexpr uint16_t MAX_PULSE_WIDTH = 2400; // the longest pulse sent to a servo
|
||
|
static constexpr uint16_t DEFAULT_PULSE_WIDTH = 1500; // default pulse width
|
||
|
|
||
|
static constexpr uint8_t LEDC_NUM_CHANNELS = 8; // default pulse width
|
||
|
|
||
|
static constexpr TickType_t TIMEOUT = portMAX_DELAY;
|
||
|
|
||
|
#define TIMER_WIDTH 16
|
||
|
|
||
|
class Pusher {
|
||
|
public:
|
||
|
Pusher(void);
|
||
|
void setup(void);
|
||
|
void dispense(int);
|
||
|
private:
|
||
|
volatile SemaphoreHandle_t xSemaphore;
|
||
|
};
|
||
|
|
||
|
#endif /* _PUSHER_H */
|