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.
Fork of EndeligKildekode by
hack_motor.h
00001 #include "mbed.h" 00002 #ifndef HACK_MOTOR_H 00003 #define HACK_MOTOR_H 00004 class Wheel { 00005 public: 00006 Wheel(PinName M1A_pin, PinName M1B_pin, PinName M2A_pin, PinName M2B_pin); 00007 ~Wheel(); 00008 void FW(); // Forward 00009 void BW(); // Backwards 00010 void right(); // Right 00011 void left(); // Left 00012 void stop(); // Stop 00013 void init(); // Init 00014 void set_speed(float speed); // set your wanted speed (0..1.0) 00015 float get_speed(); // get the actual speed 00016 void FW(float right, float left); // Overload Forward with right motor speed, left motor speed 00017 private: 00018 float fw, bw; 00019 float speed; 00020 PwmOut *M1A; 00021 PwmOut *M2A; 00022 DigitalOut *M1B; 00023 DigitalOut *M2B; 00024 }; 00025 #endif
Generated on Sat Jul 23 2022 10:05:59 by
 1.7.2
 1.7.2 
    