-
Notifications
You must be signed in to change notification settings - Fork 0
/
ATtinsal2LEds.ino
210 lines (157 loc) · 3.33 KB
/
ATtinsal2LEds.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
//please select 2 leds such that it doesn't harm the usb. You have to program and use seperately.. Works on DELL not with chargers. Still need to figure out I recommend single pin code in folder
float t=2.0;
float g=9.81;
float s=0.0;
long t2;
long n;
float e0=-13.6;
float e;
long A,B,r,n2;
long rand1;
long rand2;
long sum,product,divi,sub;
long V,I,R;
long C,H,O,Molwt;
long a,b;
float circ;
long rad;
float pi=3.141;
float spd=10.2;
float th=1.5;
float iq;
char c;
long select;
long rupee;
float Dol;
float Pound;
float Yuan;
long xd;
long ad;
void setup() {
// put your setup code here, to run once:
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
randomSeed(analogRead(A1));
int sel;
int bd=int(random(20));
int cd=int(random(10));
for(int j=0;j<cd;j++){
ad= random(10000);
xd=random(ad/1.5);
for(int i1=0;i1<bd;i1++){
sel=int(random(3));
if(sel==0) {
digitalWrite(1, HIGH); }
else if(sel==1){ digitalWrite(2, HIGH); }
else if(sel==2){ digitalWrite(2,LOW); }
else if(sel==3){ digitalWrite(1,LOW); }
for(long i2=0;i2<(xd)/100;i2++){
//Maths
rand1=random(500);
rand2=random(500);
product=rand1*rand2;
sum=rand1+rand2;
divi=rand1/rand2;
sub=rand1-rand2;
//play
a=random(10);
b=random(10);
while( a!=b)
b=random(10);
a=random(10);
b=random(10);
while( a!=b)
b=random(10);
//Physics
t2=random(500);
s=0.5*g*t2*t2;
n=random(100);
e=e0/n/n;
//play
a=random(10);
b=random(10);
while( a!=b)
b=random(10);
a=random(10);
b=random(10);
while( a!=b)
b=random(10);
}
if(select==3){
//Economics
B=random(1000);
r=random(20);
n2=random(10);
A=A0*pow((1+r/100.0),n2);
a=random(10);
b=random(10);
while( a!=b)
b=random(10);
a=random(10);
b=random(10);
while( a!=b)
b=random(10);
}
// wait for a second
sel=int(random(2));
if(sel==0) {
digitalWrite(1, HIGH); }
else if(sel==1){ digitalWrite(1,LOW); } // turn the LED off by making the voltage LOW
for(long i3=0;i3<(ad-xd)/100;i3++){
//Electrical
I=random(100);
R=random(10000);
V=I*I*R;
a=random(10);
b=random(10);
while( a!=b)
b=random(10);
a=random(10);
b=random(10);
while( a!=b)
b=random(10);
//Biochemical
C=random(20);
H=random(100);
O=random(20);
Molwt=12*C+H+16*O;
//delay(60000);
//Guessing game
a=random(10);
b=random(10);
while( a!=b)
b=random(10);
a=random(10);
b=random(10);
while( a!=b)
b=random(10);
rad=random(1000);
circ=2*pi*rad;
iq=spd*pow(th,12);
//char music[28]="CCDCFECCDCGFCCC'AGFBA#A#AFGF";
//char Joke[43]="How do you call a skeleton? On the telebone";
// wait for a second
int a[5]={2,31,4,5,6};
int temp;
for(int ab=0;ab<5;ab++){
a[ab]=random(100);
}
for(int j=0;j<4;j++){
for(int i=0;i<5-j-1;i++){
if(a[i]>a[i+1]){
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
}
rupee=random(1000);
Dol=rupee*0.013617;
Pound=rupee*0.010032;
Yuan=rupee*0.088975;
}
}
}}