Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Servomotor.hpp
00001 #pragma once 00002 #include<mbed.h> 00003 #include<PwmOut.h> 00004 #include<portSet.hpp> 00005 00006 /*パルスの単位はusでよろ*/ 00007 /* 00008 | range degree | pulse cycle | min pulse | max pulse | 00009 DS3218 |180(270もある) | 20000 | 500 | 2500 | 00010 SG90 | 180 | 20000 | 1000 | 2000 | 00011 */ 00012 class servo 00013 { 00014 public: 00015 servo(PinName signal,unsigned int range_degree,unsigned int pulse_cycle,unsigned int min_pulse,unsigned int max_pulse); 00016 void Setangle(unsigned int tar_angle); 00017 void Addangle(int tar_angle); 00018 float pulsese; 00019 private: 00020 PinName signal_; 00021 unsigned int range_degree_; 00022 unsigned int pulse_cycle_; 00023 unsigned int min_pulse_; 00024 unsigned int max_pulse_; 00025 unsigned int now_angle_; 00026 double pdp;/*pulse per degree*/ 00027 };
Generated on Sat Oct 15 2022 07:52:33 by
1.7.2