2014-06-03 16:23:26 +00:00
|
|
|
/*
|
|
|
|
* Author: Yevgeniy Kiveisha <yevgeniy.kiveisha@intel.com>
|
|
|
|
* Copyright (c) 2014 Intel Corporation.
|
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* This program and the accompanying materials are made available under the
|
|
|
|
* terms of the The MIT License which is available at
|
|
|
|
* https://opensource.org/licenses/MIT.
|
2014-06-03 16:23:26 +00:00
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* SPDX-License-Identifier: MIT
|
2014-06-03 16:23:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <iostream>
|
2017-08-30 15:00:29 -07:00
|
|
|
|
2016-04-25 14:27:51 -07:00
|
|
|
#include "es08a.hpp"
|
2017-08-30 15:00:29 -07:00
|
|
|
#include "upm_utilities.h"
|
2014-06-03 16:23:26 +00:00
|
|
|
|
|
|
|
int
|
2017-08-30 15:00:29 -07:00
|
|
|
main(int argc, char** argv)
|
2014-06-03 16:23:26 +00:00
|
|
|
{
|
2014-06-09 16:00:07 +00:00
|
|
|
//! [Interesting]
|
2017-08-30 15:00:29 -07:00
|
|
|
upm::ES08A servo(5);
|
2014-06-13 11:53:51 +01:00
|
|
|
|
2015-01-22 20:09:51 -08:00
|
|
|
// Sets the shaft to 180, then to 90, then to 0,
|
|
|
|
// then back to 90, and finally back to 180,
|
|
|
|
// pausing for a second in between each angle
|
2017-08-30 15:00:29 -07:00
|
|
|
servo.setAngle(180);
|
2015-01-22 20:09:51 -08:00
|
|
|
std::cout << "Set angle to 180" << std::endl;
|
2017-08-30 15:00:29 -07:00
|
|
|
upm_delay(1);
|
|
|
|
servo.setAngle(90);
|
2015-01-22 20:09:51 -08:00
|
|
|
std::cout << "Set angle to 90" << std::endl;
|
2017-08-30 15:00:29 -07:00
|
|
|
upm_delay(1);
|
|
|
|
servo.setAngle(0);
|
2015-01-22 20:09:51 -08:00
|
|
|
std::cout << "Set angle to 0" << std::endl;
|
2017-08-30 15:00:29 -07:00
|
|
|
upm_delay(1);
|
|
|
|
servo.setAngle(90);
|
2015-01-22 20:09:51 -08:00
|
|
|
std::cout << "Set angle to 90" << std::endl;
|
2017-08-30 15:00:29 -07:00
|
|
|
upm_delay(1);
|
|
|
|
servo.setAngle(180);
|
2015-01-22 20:09:51 -08:00
|
|
|
std::cout << "Set angle to 180" << std::endl;
|
|
|
|
//! [Interesting]
|
2014-06-03 16:23:26 +00:00
|
|
|
|
|
|
|
std::cout << "exiting application" << std::endl;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|