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
Examples
Simple_MeasureVolts
MeasureVolts_Demo.c
Go to the documentation of this file.
1
5
#include "simpletools.h"
// Include simpletools
6
#include "adcDCpropab.h"
// Include adcDCpropab
7
17
int
main
()
// Main function
18
{
19
adc_init(21, 20, 19, 18);
// CS=21, SCL=20, DO=19, DI=18
20
21
float
v2, v3;
// Voltage variables
22
23
while
(1)
// Loop repeats indefinitely
24
{
25
v2 = adc_volts(2);
// Check A/D 2
26
v3 = adc_volts(3);
// Check A/D 3
27
28
putChar(HOME);
// Cursor -> top-left "home"
29
print(
"A/D2 = %f V%c\n"
, v2, CLREOL);
// Display volts
30
print(
"A/D3 = %f V%c\n"
, v3, CLREOL);
// Display volts
31
32
pause(100);
// Wait 1/10 s
33
}
34
}
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12