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.
Module/ChargingControl.h
- Committer:
- _seminahn
- Date:
- 2021-11-30
- Revision:
- 3:a4677501ae87
File content as of revision 3:a4677501ae87:
#ifndef ZETA_STM_KINETIC_CHARGINGCONTROL_H_ #define ZETA_STM_KINETIC_CHARGINGCONTROL_H_ #include "mbed.h" #define SSR_OFF 1 #define SSR_ON 0 #include <ros.h> extern ros::NodeHandle nh; class ChargingControl { public: ChargingControl(PinName pinP, PinName pinN) : _pinP(pinP,SSR_OFF), _pinN(pinN,SSR_OFF) {} void on() { if(_pinN == SSR_OFF) { //nh.loginfo("ssr on"); _pinN = SSR_ON; //ThisThread::sleep_for(100); _pinP = SSR_ON; } } void off() { if(_pinP == SSR_ON) { //nh.loginfo("ssr off"); _pinP = SSR_OFF; //ThisThread::sleep_for(100); _pinN = SSR_OFF; } } private: void init(); DigitalOut _pinP; DigitalOut _pinN; }; #endif /* ZETA_STM_KINETIC_CHARGINGCONTROL_H_ */