-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.c
More file actions
43 lines (36 loc) · 811 Bytes
/
Copy pathtest.c
File metadata and controls
43 lines (36 loc) · 811 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
#include <stdio.h>
#include "test.h"
#include <time.h>
void delay(int number_of_microseconds){ //not actually number of seconds
// Converting time into multiples of a hundred nS
int hundred_ns = 10 * number_of_microseconds;
// Storing start time
clock_t start_time = clock();
// looping till required time is not achieved
while (clock() < start_time + hundred_ns);
}
int main()
{
//printNum("test");
printf("RED-V Example: Blink2222222\n");
setupPWM();
//setupGPIO();
//setLedState(1);
/*
while (1)
{
printf("State: %d\n", getButState());
if (getButState() == 1)
{
printf("ONNNNNNN\n");
setLedState(0);
}
else
{
printf("Off + GPIO OUTPUT: %d\n",setLedState(1));
}
delay(2000000);
}
*/
return 0;
}