Skip to content

Commit 3b1fd6b

Browse files
authored
Merge pull request #213 from PropGit/master
Added Greg LaPolla's objects: P1 ADS1118 (C and Spin), P2 ADS1118, and P2 ILI9341.
2 parents 159570e + 000bc61 commit 3b1fd6b

File tree

86 files changed

+8794
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+8794
-0
lines changed

docs/p2.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ by Dave Hein
211211
## Recent Activity
212212
##### _Full details [here](https://github.com/parallaxinc/propeller/pulls?q=is%3Aclosed)._
213213

214+
* Added object from Greg LaPolla's
215+
* P1 [ADS1118 C](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p1/All/ads1118/C)
216+
* P1 [ADS1118 Spin](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p1/All/ads1118/Spin)
217+
* P2 [ADS1118](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/ads1118)
218+
* P2 [ILI9341](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/ili9341)
214219
* Added Dennis Gately's (and BR's) [DS1302 Full](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/DS1302_full) object.
215220
* Added Jon "JonnyMac" McPhalen's [Quiic Twist](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/jm_quiic_twist) object
216221
* Added Objects from Jon "JonnyMac" McPhalen
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ADS1118.c
2+
>compiler=C
3+
>memtype=cmm main ram compact
4+
>optimize=-Os
5+
>-m32bit-doubles
6+
>-Wall
7+
>-fno-exceptions
8+
>BOARD::ACTIVITYBOARD
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# libads1118
2+
3+
## Language
4+
5+
C
6+
7+
## Category
8+
9+
Sensor
10+
11+
## Description
12+
13+
libads1118 is a c library that interfaces the TI ADS1118 chip with the Propeller P8X32A
14+
15+
Learn more about the Propeller at [www.parallax.com](http://www.parallax.com).
16+
17+
18+
19+
## License
20+
21+
Copyright © 2020 Greg LaPolla libads1118 is licensed under the MIT License.
22+
23+
## Credits
24+
25+
libads1118 is developed by Greg LaPolla.
26+
This Driver was derived from the arduino driver localted at [Github](https://github.com/denkitronik/ADS1118).
27+
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* @file ads1118_decodeConfigRegister.c
3+
*
4+
* @author Greg LaPolla
5+
*
6+
* @version 0.1
7+
*
8+
* @copyright Copyright (C) 2020. See end of file for
9+
* terms of use (MIT License).
10+
*
11+
* @brief This is a driver that allows the Propeller Multicore Microcontroller to
12+
* commnicate with the TI ADS1118 16 bit ADC with compensatin temperature sensor
13+
*
14+
*/
15+
16+
#include "simpletools.h"
17+
#include "ads1118.h"
18+
19+
20+
double volts;
21+
double temp;
22+
uint16_t adc;
23+
24+
25+
int main() // Main function
26+
{
27+
28+
ads1118_init(22,23,20,21);
29+
30+
ads1118_enableNOP();
31+
ads1118_enablePullup();
32+
ads1118_setSamplingRate(RATE_128SPS);
33+
ads1118_setSingleShotMode();
34+
ads1118_setFullScaleRange(FSR_0256);
35+
ads1118_enableSingleStart();
36+
37+
38+
while(1)
39+
{
40+
adc = ads1118_getADCValue(DIFF_0_1);
41+
print("\n%cadc 1 reading = %d%c\n\n", HOME, adc, CLREOL); // Display adc reading
42+
43+
ads1118_decodeconfigRegister(configRegister);
44+
45+
adc = ads1118_getADCValue(DIFF_2_3);
46+
print("\nadc 2 reading = %d%c\n\n",adc, CLREOL); // Display adc reading
47+
48+
ads1118_decodeconfigRegister(configRegister);
49+
50+
volts = ads1118_getMilliVolts(DIFF_0_1);
51+
print("\nMillivolts 1 = %f%c\n\n",volts,CLREOL); // Display milivolts
52+
53+
ads1118_decodeconfigRegister(configRegister);
54+
55+
volts = ads1118_getMilliVolts(DIFF_2_3);
56+
print("\nMillivolts 2 = %f%c\n\n",volts,CLREOL); // Display milivolts
57+
58+
ads1118_decodeconfigRegister(configRegister);
59+
60+
temp = (ads1118_getTemperature() * 9 / 5) + 32;
61+
print("\nTemperature = %f%c\n",temp,CLREOL); // Display milivolts
62+
63+
pause(1000);
64+
}
65+
}

0 commit comments

Comments
 (0)