PushToGo on STM32F429-Disco Board

Dependencies:   BSP_DISCO_F429ZI LCD_DISCO_F429ZI pushtogo usb

AdaptiveAxis.cpp

Committer:
caoyu@caoyuan9642-desktop.MIT.EDU
Date:
2018-09-23
Revision:
8:f0455a1d4709
Parent:
1:64c1fd738059

File content as of revision 8:f0455a1d4709:

/*
 * AdaptiveAxis.cpp
 *
 *  Created on: 2018Äê2ÔÂ24ÈÕ
 *      Author: caoyuan9642
 */

#include <AdaptiveAxis.h>

void AdaptiveAxis::slew_mode()
{
	this->stepper->poweron();
	this->stepper->setMicroStep(
			TelescopeConfiguration::getInt("microstep_slew"));
	this->stepper->setCurrent(
			TelescopeConfiguration::getDouble("current_slew"));
}

void AdaptiveAxis::track_mode()
{
	this->stepper->poweron();
	this->stepper->setMicroStep(
			TelescopeConfiguration::getInt("microstep_track"));
	this->stepper->setCurrent(
			TelescopeConfiguration::getDouble("current_track"));
}

void AdaptiveAxis::correction_mode()
{
	this->stepper->poweron();
	this->stepper->setMicroStep(
			TelescopeConfiguration::getInt("microstep_correction"));
	this->stepper->setCurrent(
			TelescopeConfiguration::getDouble("current_correction"));
}

void AdaptiveAxis::idle_mode()
{
	double idle_current = TelescopeConfiguration::getDouble("current_idle");
	if (idle_current != 0)
		this->stepper->setCurrent(idle_current);
	else
		this->stepper->poweroff();
}