I am hoping to use the LilyPad hardware to help my son. He was born with a disorder that causes him to move his head in a rhythmic motion at certain times. He has seen multiple doctors and neurologist over the course of ten years. Medically nothing can be done to help his issue, however they stated that as he gets older he might learn to recognize the motion and stop it himself.
My hope is that with the lilypad hardware it can be placed into a hat and using an accelerometer the motion can be recorded and a LED light lights up when the motion is detected. This should alert him to the motion and help him learn how to stop it.
I have already bought all the hardware and paid a individual to write the needed program. However once the program is installed on the hardware, the motion seems to not trip the needed altering feature (LED, Buzzer, or so on.) I have played with the program a little but my technical knowledge is very limited when it comes to this stuff.
I am hoping by coming to a forum for help that someone might be able to help me find the issue. I will attach all that I have on this project. Please let me know if anyone can help.
#define ONBOARD_LED_PIN 13
#define NOTIFICATION_PIN 2
#define PROGRAM_LED_PIN 5
void setup() {
pinMode(ONBOARD_LED_PIN, OUTPUT);
pinMode(NOTIFICATION_PIN, OUTPUT);
pinMode(PROGRAM_LED_PIN, OUTPUT);
Serial.begin(115200);
}
void loop() {
Serial.print(analogRead(A0));
Serial.print(" ");
Serial.print(analogRead(A1));
Serial.print(" ");
Serial.println(analogRead(A2));
digitalWrite(ONBOARD_LED_PIN, HIGH);
digitalWrite(NOTIFICATION_PIN, HIGH);
digitalWrite(PROGRAM_LED_PIN, HIGH);
delay(200);
digitalWrite(ONBOARD_LED_PIN, LOW);
digitalWrite(NOTIFICATION_PIN, LOW);
digitalWrite(PROGRAM_LED_PIN, LOW);
delay(200);
}
CrightonMotionSensor-2.ino (657 Bytes)