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.
ADS1015.h@1:c1ddf7c2d65b, 2018-06-27 (annotated)
- Committer:
- xorjoep
- Date:
- Wed Jun 27 09:11:26 2018 +0000
- Revision:
- 1:c1ddf7c2d65b
- Parent:
- 0:94493b8b0fb0
- Child:
- 2:2bf91fd23a1a
Now works + getSample function applied
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| xorjoep | 0:94493b8b0fb0 | 1 | #define ADDR_ADS1015_0 0b10010010 //VDD |
| xorjoep | 0:94493b8b0fb0 | 2 | #define ADDR_ADS1015_1 0b10010000 //GND |
| xorjoep | 0:94493b8b0fb0 | 3 | #define ADDR_ADS1015_2 0b10010100 //SDA |
| xorjoep | 1:c1ddf7c2d65b | 4 | #define ADDR_ADS1015_3 0b10010110 //SDL |
| xorjoep | 0:94493b8b0fb0 | 5 | |
| xorjoep | 0:94493b8b0fb0 | 6 | #define AD1015_REG_CONVERSION_RESULT 0x00 |
| xorjoep | 0:94493b8b0fb0 | 7 | #define AD1015_REG_CONFIG 0x01 |
| xorjoep | 0:94493b8b0fb0 | 8 | |
| xorjoep | 0:94493b8b0fb0 | 9 | #define AD1015_CONFIG_FSR_6144 0x0000 |
| xorjoep | 0:94493b8b0fb0 | 10 | #define AD1015_CONFIG_FSR_4096 0x0200 |
| xorjoep | 0:94493b8b0fb0 | 11 | #define AD1015_CONFIG_FSR_2048 0x0400 |
| xorjoep | 0:94493b8b0fb0 | 12 | #define AD1015_CONFIG_FSR_1024 0x0600 |
| xorjoep | 0:94493b8b0fb0 | 13 | #define AD1015_CONFIG_FSR_0512 0x0800 |
| xorjoep | 0:94493b8b0fb0 | 14 | #define AD1015_CONFIG_FSR_0256 0x0A00 |
| xorjoep | 0:94493b8b0fb0 | 15 | #define AD1015_CONFIG_MUX_AIN0_AIN1 0x0000 |
| xorjoep | 0:94493b8b0fb0 | 16 | #define AD1015_CONFIG_MUX_AIN0_AIN3 0x1000 |
| xorjoep | 0:94493b8b0fb0 | 17 | #define AD1015_CONFIG_MUX_AIN1_AIN3 0x2000 |
| xorjoep | 0:94493b8b0fb0 | 18 | #define AD1015_CONFIG_MUX_AIN2_AIN3 0x3000 |
| xorjoep | 0:94493b8b0fb0 | 19 | #define AD1015_CONFIG_MUX_AIN0_GND 0x4000 |
| xorjoep | 0:94493b8b0fb0 | 20 | #define AD1015_CONFIG_MUX_AIN1_GND 0x5000 |
| xorjoep | 0:94493b8b0fb0 | 21 | #define AD1015_CONFIG_MUX_AIN2_GND 0x6000 |
| xorjoep | 0:94493b8b0fb0 | 22 | #define AD1015_CONFIG_MUX_AIN3_GND 0x7000 |
| xorjoep | 0:94493b8b0fb0 | 23 | |
| xorjoep | 1:c1ddf7c2d65b | 24 | double getSample(I2C* i2c_plate, uint8_t ADC_address, uint16_t sensor_address); |
| xorjoep | 0:94493b8b0fb0 | 25 | void startSingleShotConversion(I2C* i2c_plate, uint8_t address, uint16_t config); |
| xorjoep | 0:94493b8b0fb0 | 26 | double readConversionResult(I2C* i2c_plate, uint8_t address, uint16_t config); |
| xorjoep | 0:94493b8b0fb0 | 27 | double data_to_voltage(int16_t data, uint16_t config); |