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: ActiveCaster_ ActiveCaster_2
AMT22.h
- Committer:
- e5119053f6
- Date:
- 2022-01-24
- Revision:
- 0:5e4f1e288e2a
File content as of revision 0:5e4f1e288e2a:
#ifndef _AMT22_H
#define _AMT22_H
#include "mbed.h"
#include "define.h"
//#include <SPI.h>
class AMT203V{
public:
AMT203V(SPI*, PinName);
int spi_write(int msg);
int init();
int getEncount();
void updateCount();
int setZeroPos();
int getRawEncount();
private:
bool init_done;
//unsigned char CSBpin;
const int res = 0x3FFF;//4096;
unsigned int ABSposition; // rawdata
unsigned int preABSposition;
int rotation = 0;
int encount; // 渡す値
int temp[2];
SPI *pSPI;
DigitalOut *CSBpin;
};
#endif