summaryrefslogtreecommitdiff
path: root/Resources/OpenPLCv2/firmware/ADC.test.arduino/spi_ads1018/spi_ads1018.ino
diff options
context:
space:
mode:
Diffstat (limited to 'Resources/OpenPLCv2/firmware/ADC.test.arduino/spi_ads1018/spi_ads1018.ino')
-rw-r--r--Resources/OpenPLCv2/firmware/ADC.test.arduino/spi_ads1018/spi_ads1018.ino21
1 files changed, 21 insertions, 0 deletions
diff --git a/Resources/OpenPLCv2/firmware/ADC.test.arduino/spi_ads1018/spi_ads1018.ino b/Resources/OpenPLCv2/firmware/ADC.test.arduino/spi_ads1018/spi_ads1018.ino
new file mode 100644
index 0000000..8e1290a
--- /dev/null
+++ b/Resources/OpenPLCv2/firmware/ADC.test.arduino/spi_ads1018/spi_ads1018.ino
@@ -0,0 +1,21 @@
+
+#include<SPI.h>
+
+/* ADS1018 settings */
+
+const long int speedMaximum = 4000000; // frequency of communication
+const char dataOrder = MSBFIRST;
+const char dataMode = SPI_MODE1;
+
+void setup() {
+
+ Serial.begin(9600); //start serial
+ SPI.begin(); // start SPI library
+
+}
+
+void loop() {
+
+ SPI.beginTransaction(SPISettings(speedMaximum, dataOrder, dataMode));
+
+}