aufgaben weil vergesen zu commiten
This commit is contained in:
@@ -3,20 +3,20 @@
|
||||
//
|
||||
//
|
||||
// Authors:
|
||||
// Peter Polidoro peterpolidoro@gmail.com
|
||||
// Peter Polidoro peter@polidoro.io
|
||||
// ----------------------------------------------------------------------------
|
||||
#include "Constants.h"
|
||||
|
||||
|
||||
namespace constants
|
||||
{
|
||||
const uint8_t device_address = 0x40;
|
||||
const size_t output_enable_pin = 2;
|
||||
const PCA9685::DeviceAddress device_address = 0x40;
|
||||
const PCA9685::Pin output_enable_pin = 2;
|
||||
|
||||
const long baud = 115200;
|
||||
|
||||
const size_t loop_delay = 100;
|
||||
const uint16_t frequency = 200;
|
||||
const uint16_t time_increment = 400;
|
||||
const double epsilon = 0.001;
|
||||
const PCA9685::Frequency frequency = 200;
|
||||
const PCA9685::Time time_increment = 400;
|
||||
const PCA9685::Percent epsilon = 0.001;
|
||||
}
|
||||
|
||||
@@ -3,22 +3,23 @@
|
||||
//
|
||||
//
|
||||
// Authors:
|
||||
// Peter Polidoro peterpolidoro@gmail.com
|
||||
// Peter Polidoro peter@polidoro.io
|
||||
// ----------------------------------------------------------------------------
|
||||
#ifndef CONSTANTS_H
|
||||
#define CONSTANTS_H
|
||||
#include <Arduino.h>
|
||||
#include <PCA9685.h>
|
||||
|
||||
|
||||
namespace constants
|
||||
{
|
||||
extern const uint8_t device_address;
|
||||
extern const size_t output_enable_pin;
|
||||
extern const PCA9685::DeviceAddress device_address;
|
||||
extern const PCA9685::Pin output_enable_pin;
|
||||
|
||||
extern const long baud;
|
||||
extern const size_t loop_delay;
|
||||
extern const uint16_t frequency;
|
||||
extern const uint16_t time_increment;
|
||||
extern const double epsilon;
|
||||
extern const PCA9685::Frequency frequency;
|
||||
extern const PCA9685::Time time_increment;
|
||||
extern const PCA9685::Percent epsilon;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7,25 +7,25 @@
|
||||
|
||||
PCA9685 pca9685;
|
||||
|
||||
uint16_t time_min;
|
||||
uint16_t time_max;
|
||||
PCA9685::Time time_min;
|
||||
PCA9685::Time time_max;
|
||||
|
||||
uint8_t channel;
|
||||
PCA9685::Channel channel;
|
||||
|
||||
uint16_t on_time_set;
|
||||
uint16_t off_time_set;
|
||||
uint16_t on_time_get;
|
||||
uint16_t off_time_get;
|
||||
PCA9685::Time on_time_set;
|
||||
PCA9685::Time off_time_set;
|
||||
PCA9685::Time on_time_get;
|
||||
PCA9685::Time off_time_get;
|
||||
|
||||
uint16_t pulse_width_set;
|
||||
uint16_t phase_shift_set;
|
||||
uint16_t pulse_width_get;
|
||||
uint16_t phase_shift_get;
|
||||
PCA9685::Duration pulse_width_set;
|
||||
PCA9685::Duration phase_shift_set;
|
||||
PCA9685::Duration pulse_width_get;
|
||||
PCA9685::Duration phase_shift_get;
|
||||
|
||||
double duty_cycle_set;
|
||||
double percent_delay_set;
|
||||
double duty_cycle_get;
|
||||
double percent_delay_get;
|
||||
PCA9685::Percent duty_cycle_set;
|
||||
PCA9685::Percent percent_delay_set;
|
||||
PCA9685::Percent duty_cycle_get;
|
||||
PCA9685::Percent percent_delay_get;
|
||||
|
||||
void setup()
|
||||
{
|
||||
@@ -67,7 +67,7 @@ void loop()
|
||||
on_time_set = time_min;
|
||||
off_time_set = time_max;
|
||||
}
|
||||
for (uint8_t channel=0; channel < pca9685.getChannelCount(); ++channel)
|
||||
for (PCA9685::Channel channel=0; channel < pca9685.getChannelCount(); ++channel)
|
||||
{
|
||||
Serial << "frequency: " << pca9685.getFrequency() << "\n";
|
||||
Serial << "channel: " << channel << ", on_time_set: " << on_time_set << ", off_time_set: " << off_time_set << "\n";
|
||||
|
||||
Reference in New Issue
Block a user