Library for working with the HYCON HY3116/8 24-bit weigh-scales ADC series.

Committer:
seajayshore
Date:
Wed May 11 12:11:43 2016 +0000
Revision:
0:80768ca5d5ff
Child:
1:1967c3f48465
1st commit! woo!

Who changed what in which revision?

UserRevisionLine numberNew 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 0:80768ca5d5ff 16 protected:
seajayshore 0:80768ca5d5ff 17 public:
seajayshore 0:80768ca5d5ff 18 void writeByte(uint8_t address, uint8_t subAddress, uint8_t data);
seajayshore 0:80768ca5d5ff 19 void resetChip();
seajayshore 0:80768ca5d5ff 20 void readBytes(uint8_t address, uint8_t subAddress, uint8_t byteNum, uint8_t* dest, bool alreadyRead);
seajayshore 0:80768ca5d5ff 21 int32_t readAdc(bool alreadyRead);
seajayshore 0:80768ca5d5ff 22 void init();
seajayshore 0:80768ca5d5ff 23
seajayshore 0:80768ca5d5ff 24 };