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.
Dependents: quadOmni_yanagi NHK2017_octopus ikarashiMDCmaster NHK2017_octopus2 ... more
ikarashiMDC Class Reference
Ikarashi MDC class MDC libraly Example : More...
#include <ikarashiMDC.h>
Public Member Functions | |
ikarashiMDC (DigitalOut *serialcontrol, uint8_t taddr, uint8_t tmotorNum, bool tmode, Serial *tserial) | |
Create ikarashiMDC inctance. | |
int | setSpeed (const double &speed) |
drive motor |
Detailed Description
Ikarashi MDC class MDC libraly Example :
#include "mbed.h" #include "ikarashiMDC.h" Serial serial(PC_10,PC_11); DigitalOut serialcontrol(D2); ikarashiMDC ikarashi[]{ ikarashiMDC(&serialcontrol,2,2,SM,&serial), ikarashiMDC(&serialcontrol,2,3,LAP,&serial), }; PwmOut pwm(LED1); int main() { serial.baud(38400); float i = -1; while(1) { ikarashi[0].setSpeed(i); ikarashi[1].setSpeed(i); i += 0.01; pwm = fabs(i); wait_ms(20); if(i >= 1) i = -1; } } *
Definition at line 47 of file ikarashiMDC.h.
Constructor & Destructor Documentation
ikarashiMDC | ( | DigitalOut * | serialcontrol, |
uint8_t | taddr, | ||
uint8_t | tmotorNum, | ||
bool | tmode, | ||
Serial * | tserial | ||
) |
Create ikarashiMDC inctance.
- Parameters:
-
address of cs pin for rs485 addr for MDC ch for motor mdc mode (LAP or SM) address of serial object
Definition at line 4 of file ikarashiMDC.cpp.
Member Function Documentation
int setSpeed | ( | const double & | speed ) |
Generated on Fri Jul 15 2022 08:39:38 by
