You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
924 B
Java

8 years ago
int stimTime = 0;
void rectangularStim(int intensity, int stimTime) {
if (t%(4*stimTime) < stimTime) {
arduino.analogWrite(down, intensity); // Turns on arduino light (can make ledPin into a parameter that is passed in)
} else {
arduino.analogWrite(down, 0);
}
if (t%(4*stimTime) >= stimTime && t%(4*stimTime) < 2*stimTime) {
arduino.analogWrite(left, intensity);
} else {
arduino.analogWrite(left, 0);
}
if (t%(4*stimTime) >= 2*stimTime && t%(4*stimTime) < 3*stimTime){
arduino.analogWrite(up, intensity);
} else {
arduino.analogWrite(up, 0);
}
if (t%(4*stimTime) >= 3*stimTime && t%(4*stimTime) < 4*stimTime){
arduino.analogWrite(right, intensity);
} else {
arduino.analogWrite(right, 0);
}
t_temp = t_temp + 1;
t = t_temp / FrameRate;
}