Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/p2.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ by Dave Hein
## Recent Activity
##### _Full details [here](https://github.com/parallaxinc/propeller/pulls?q=is%3Aclosed)._

* Added object from Greg LaPolla's
* P1 [ADS1118 C](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p1/All/ads1118/C)
* P1 [ADS1118 Spin](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p1/All/ads1118/Spin)
* P2 [ADS1118](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/ads1118)
* P2 [ILI9341](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/ili9341)
* Added Dennis Gately's (and BR's) [DS1302 Full](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/DS1302_full) object.
* Added Jon "JonnyMac" McPhalen's [Quiic Twist](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/jm_quiic_twist) object
* Added Objects from Jon "JonnyMac" McPhalen
Expand Down
8 changes: 8 additions & 0 deletions libraries/community/p1/All/ads1118/C/ADS1118.side
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ADS1118.c
>compiler=C
>memtype=cmm main ram compact
>optimize=-Os
>-m32bit-doubles
>-Wall
>-fno-exceptions
>BOARD::ACTIVITYBOARD
27 changes: 27 additions & 0 deletions libraries/community/p1/All/ads1118/C/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# libads1118

## Language

C

## Category

Sensor

## Description

libads1118 is a c library that interfaces the TI ADS1118 chip with the Propeller P8X32A

Learn more about the Propeller at [www.parallax.com](http://www.parallax.com).



## License

Copyright © 2020 Greg LaPolla libads1118 is licensed under the MIT License.

## Credits

libads1118 is developed by Greg LaPolla.
This Driver was derived from the arduino driver localted at [Github](https://github.com/denkitronik/ADS1118).

65 changes: 65 additions & 0 deletions libraries/community/p1/All/ads1118/C/ads1118.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* @file ads1118_decodeConfigRegister.c
*
* @author Greg LaPolla
*
* @version 0.1
*
* @copyright Copyright (C) 2020. See end of file for
* terms of use (MIT License).
*
* @brief This is a driver that allows the Propeller Multicore Microcontroller to
* commnicate with the TI ADS1118 16 bit ADC with compensatin temperature sensor
*
*/

#include "simpletools.h"
#include "ads1118.h"


double volts;
double temp;
uint16_t adc;


int main() // Main function
{

ads1118_init(22,23,20,21);

ads1118_enableNOP();
ads1118_enablePullup();
ads1118_setSamplingRate(RATE_128SPS);
ads1118_setSingleShotMode();
ads1118_setFullScaleRange(FSR_0256);
ads1118_enableSingleStart();


while(1)
{
adc = ads1118_getADCValue(DIFF_0_1);
print("\n%cadc 1 reading = %d%c\n\n", HOME, adc, CLREOL); // Display adc reading

ads1118_decodeconfigRegister(configRegister);

adc = ads1118_getADCValue(DIFF_2_3);
print("\nadc 2 reading = %d%c\n\n",adc, CLREOL); // Display adc reading

ads1118_decodeconfigRegister(configRegister);

volts = ads1118_getMilliVolts(DIFF_0_1);
print("\nMillivolts 1 = %f%c\n\n",volts,CLREOL); // Display milivolts

ads1118_decodeconfigRegister(configRegister);

volts = ads1118_getMilliVolts(DIFF_2_3);
print("\nMillivolts 2 = %f%c\n\n",volts,CLREOL); // Display milivolts

ads1118_decodeconfigRegister(configRegister);

temp = (ads1118_getTemperature() * 9 / 5) + 32;
print("\nTemperature = %f%c\n",temp,CLREOL); // Display milivolts

pause(1000);
}
}
Loading