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.
ChargingControl.h
00001 #ifndef ZETA_STM_KINETIC_CHARGINGCONTROL_H_ 00002 #define ZETA_STM_KINETIC_CHARGINGCONTROL_H_ 00003 #include "mbed.h" 00004 #define SSR_OFF 1 00005 #define SSR_ON 0 00006 00007 #include <ros.h> 00008 extern ros::NodeHandle nh; 00009 00010 class ChargingControl { 00011 public: 00012 ChargingControl(PinName pinP, PinName pinN) : _pinP(pinP,SSR_OFF), _pinN(pinN,SSR_OFF) {} 00013 void on() 00014 { 00015 if(_pinN == SSR_OFF) 00016 { 00017 //nh.loginfo("ssr on"); 00018 _pinN = SSR_ON; 00019 //ThisThread::sleep_for(100); 00020 _pinP = SSR_ON; 00021 } 00022 } 00023 void off() 00024 { 00025 if(_pinP == SSR_ON) 00026 { 00027 //nh.loginfo("ssr off"); 00028 _pinP = SSR_OFF; 00029 //ThisThread::sleep_for(100); 00030 _pinN = SSR_OFF; 00031 } 00032 } 00033 private: 00034 void init(); 00035 DigitalOut _pinP; 00036 DigitalOut _pinN; 00037 }; 00038 00039 #endif /* ZETA_STM_KINETIC_CHARGINGCONTROL_H_ */
Generated on Tue Jul 12 2022 18:31:23 by
1.7.2