-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNOISE.ino
61 lines (40 loc) · 1.07 KB
/
NOISE.ino
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
47
48
49
50
51
52
53
54
55
56
57
58
//Main ile
// Libraries ------->
#include "macros.hpp"
#include "rand.h" //For random number generation
#include "hypercube_engine.hpp"
//Cube
#define NOISE_OBS_CUBE_EDGE
#define NOISE_BOX_CUBE_EDGE
Hypercube<NOISE_DIMENSIONS, NOISE_NO_WALKERS, NOISE_OBS_CUBE_EDGE, NOISE_MAXSTEP> hcube;
void setup()
{
//Pin Modes
pinMode(TTL_PIN, OUTPUT);
pinMode(NOISE_SYNC_PIN, OUTPUT);
pinMode(COUNTLOSS_PIN, OUTPUT);
pinMode(INVOL_PIN, OUTPUT);
pinMode(SETUP_LED, OUTPUT);
pinMode(RUN_LED, OUTPUT);
pinMode(NOISE_EMPTY_ENTROPY_PIN, INPUT);
digitalWrite(SETUP_LED_LED, HIGH);
//Init Serial
Serial.begin(115200);
while(!Serial){}
//Init → Software Resources
Rand::init(Walkers_No, Edge, StepSize);
Pulse::init(gatetime_us, pulseduration_us);
hcube.init();
digitalWrite(SETUP_LED_LED, LOW);
}
void loop()
{
#if NOISE_SYNC_OPERATION == 1
while(digitalRead(SYNC_PIN) != HIGH) {delay(10);}
#endif
digitalWrite(RUN_LED, HIGH);
hcube.evolve();
digitalWrite(RUN_LED, LOW);
exit(0);
//Stall processor till reset or exit program successfully on PC
} //End of loop()