PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Simple Libraries
Convert
libadcACpropab
libadcACpropab.c
1
/*
2
* @file libadcACpropab.c
3
*
4
* @author Andy Lindsay
5
*
6
* @copyright
7
* Copyright (C) Parallax, Inc. 2013. All Rights MIT Licensed.
8
*
9
* @brief Project and test harness for the adcACpropab library.
10
*/
11
12
#include "simpletools.h"
13
14
#include "simpletools.h"
// Include simpletools
15
#include "adcACpropab.h"
// Include adcACpropab
16
17
int
adcVal[4];
// Required by adcPropABac
18
19
int
main
()
// Main function
20
{
21
pause(1000);
// Wait 1 s for Terminal app
22
23
adc_start(19, 18, 20, 21,
// CS=21, SCL=20, DO=19, DI=18
24
0b0101,
// Ch3 off, 2 on, 1 off, 0 on
25
adcVal);
// Array for measurements
26
27
int
i = 0;
// Index variable
28
while
(1)
// Loop repeats indefinitely
29
{
30
print(
"adcVal[%d] = %d%c\n"
, i,
// Display raw ADC
31
adcVal[i], CLREOL);
32
pause(100);
// Wait 1/10 s
33
34
i++;
// Add 1 to index
35
if
(i == 4)
// After index = 3
36
{
37
i = 0;
// Reset to zero
38
print(
"%c"
, HOME);
// Cursor home
39
}
40
}
41
}
42
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12