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: Motorino_Lib xxx_Motorino_Lib
Motorino.h
00001 #include "mbed.h" 00002 #include "platform/mbed_thread.h" 00003 00004 #define adresse 0x80 00005 #define EXTCLK 1<<6 00006 #define SLEEP 1<<4 00007 #define AI 1<<5 00008 #define PRE_SCALE 0xFE 00009 00010 #define MODE1 0x0 00011 #define MODE2 0x1 00012 #define LED0_ON_L 0x06 00013 00014 #define SDA D14 00015 #define SCL D15 00016 00017 class Motorino 00018 { 00019 I2C *motorino; 00020 static Motorino *meinMotorino; 00021 00022 private: 00023 Motorino(PinName sda, PinName scl); 00024 char getLED_ON_L(int nr); 00025 char getLED_ON_H(int nr); 00026 char getLED_OFF_L(int nr); 00027 char getLED_OFF_H(int nr); 00028 volatile bool busy=false; 00029 00030 public: 00031 static Motorino* gibMotorino(); 00032 void WriteToASpecificRegister(char RegAdr,char Wert); 00033 void setDutyCycle(float dtc, int lednr); 00034 void init(); 00035 void servo(float pos,int nr,float start=5, float end=10); //pos 0..180° 00036 00037 };
Generated on Mon Sep 5 2022 02:15:19 by
1.7.2