Hardware Reference
In-Depth Information
Table 6-2. Channel addresses
CHANNEL
ADDRESS
0
0xDC
1
0x9C
2
0xCC
3
0x8C
4
0xAC
5
0xEC
6
0xBC
7
0xFC
The following example program reads every channel continuously, waiting five sec-
onds between iterations. With a wire connecting the 5 V pin with some of the pins of
the ADC, it should read a value close to 5.000000:
//Include arduPi library
#include "arduPi.h"
unsigned char val_0 = 0;
unsigned char val_1 = 0;
byte address = 0x08;
int channel_0 = 0;
int channel_1 = 0;
int channel_2 = 0;
int channel_3 = 0;
int channel_4 = 0;
int channel_5 = 0;
int channel_6 = 0;
int channel_7 = 0;
float analog_0 = 0.0;
float analog_1 = 0.0;
float analog_2 = 0.0;
float analog_3 = 0.0;
float analog_4 = 0.0;
float analog_5 = 0.0;
float analog_6 = 0.0;
float analog_7 = 0.0;
void setup()
{
 
Search WWH ::




Custom Search