-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
47 lines (34 loc) · 894 Bytes
/
test.cpp
File metadata and controls
47 lines (34 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "definitions.h"
#include "vcmdas.h"
#include "python_io.h"
#include <stdio.h>
#include <stdlib.h>
/** This is a little test program that is for testing loop
* closure time on our I/O querying and writing
*/
int main()
{
unsigned char foo = 0xF0;
printf("FOO=%d\n", foo);
bitset(2, &foo);
printf("FOO=%d\n", foo);
bitunset(2, &foo);
printf("FOO=%d\n", foo);
VCMDAS* das = new VCMDAS();
PythonIO* board = new PythonIO();
das->setDigitalDirection(0, false);
das->setDigitalDirection(1, false);
for(int j=0; j < 10000; j++)
{
for(unsigned char i=0; i<16; i++)
double crap = das->getAnalog(i);
for(unsigned char i=0; i<2; i++)
das->setAnalog(i, 0);
for(unsigned char i=0; i<4; i++)
unsigned char crap = board->getDigital(i);
for(unsigned char i=0; i<4; i++)
unsigned short crap = board->getAnalog(i);
board->setPWMDuty(22);
}
return 0;
};