I have been through http://arduino.cc/en/Hacking/LibraryTutorial but i can't do it. It doesn't work and its not specific enough so can someone tell me how toWhenever I create a library for arduino or send me a video tutorial for hownew sketch and try to create one i cant found any tutorial anywhere but that one above butsave it doesn't make any sense my code is here
int sensorpin = 5; int target = 0; int targeta = 0; int pin = 1; boolean motionfound = false ; void setup() { pinMode(sensorpin, OUTPUT); delay(1000); } void loop() { motion(); motiontrue(); delay(10); } void motion(){ target = analogRead(sensorpin); delay(75); targeta = analogRead(sensorpin); if(targeta < target) { boolean motionfound = true; } if(targeta > target) { boolean motionfound = true; } if(targeta == target) { boolean motionfound = false; } } void motiontrue(){ if(motionfound == true){ pinMode(pin, OUTPUT); } }
so how am i meant to convertas .cpp or .h from the Save As button in the Arduino IDE, it gets saved as _cpp and _h. I am not able to create a library if i cant follow that tutorial i cant find any other ones and now no one can tell me how tothis way. How do itI create a new library? What am I missing here?