Library for working with the HYCON HY3116/8 24-bit weigh-scales ADC series.
HY3116.h@2:2da9fbab02b7, 2016-06-13 (annotated)
- Committer:
- seajayshore
- Date:
- Mon Jun 13 00:43:19 2016 +0000
- Revision:
- 2:2da9fbab02b7
- Parent:
- 1:1967c3f48465
- Child:
- 3:535ed9a0ce59
June 12 - freeze for China trip
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
seajayshore | 0:80768ca5d5ff | 1 | #include "mbed.h" |
seajayshore | 0:80768ca5d5ff | 2 | |
seajayshore | 0:80768ca5d5ff | 3 | #define HY3116_ADDRESS 0xA0 |
seajayshore | 0:80768ca5d5ff | 4 | |
seajayshore | 0:80768ca5d5ff | 5 | #define SYS 0x00 |
seajayshore | 0:80768ca5d5ff | 6 | #define ADC1 0x01 |
seajayshore | 0:80768ca5d5ff | 7 | #define ADC2 0x02 |
seajayshore | 0:80768ca5d5ff | 8 | #define ADC3 0x03 |
seajayshore | 0:80768ca5d5ff | 9 | #define ADC4 0x04 |
seajayshore | 0:80768ca5d5ff | 10 | #define ADO 0x05 |
seajayshore | 0:80768ca5d5ff | 11 | #define RESET 0x06 |
seajayshore | 0:80768ca5d5ff | 12 | |
seajayshore | 0:80768ca5d5ff | 13 | /* Function Prototypes */ |
seajayshore | 0:80768ca5d5ff | 14 | class HY3116 |
seajayshore | 0:80768ca5d5ff | 15 | { |
seajayshore | 2:2da9fbab02b7 | 16 | public: |
seajayshore | 0:80768ca5d5ff | 17 | void writeByte(uint8_t address, uint8_t subAddress, uint8_t data); |
seajayshore | 0:80768ca5d5ff | 18 | void resetChip(); |
seajayshore | 0:80768ca5d5ff | 19 | void readBytes(uint8_t address, uint8_t subAddress, uint8_t byteNum, uint8_t* dest, bool alreadyRead); |
seajayshore | 1:1967c3f48465 | 20 | bool readAdc(int32_t *_adcReading); |
seajayshore | 0:80768ca5d5ff | 21 | void init(); |
seajayshore | 0:80768ca5d5ff | 22 | |
seajayshore | 0:80768ca5d5ff | 23 | }; |