LLMind/apply_stimulation/apply_stimulation.ino
2024-10-17 19:24:48 +03:00

27 lines
677 B
C++

#include <avr/pgmspace.h>
#include "stimulation_pattern.h"
const int stimulationPin = 5;
const int delayBetweenStimulations = 10; // milliseconds
void setup() {
pinMode(stimulationPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
for (uint16_t i = 0; i < PATTERN_SIZE; i++) {
uint8_t stimulationValue = pgm_read_byte(&stimulation_pattern[i]);
analogWrite(stimulationPin, stimulationValue);
// Print the current stimulation value for debugging
Serial.print("Applying stimulation: ");
Serial.println(stimulationValue);
delay(delayBetweenStimulations);
}
// Add a longer delay at the end of each complete pattern
delay(1000);
}