Jump to content
43oh

fughilli

Members
  • Content Count

    11
  • Joined

  • Last visited

Reputation Activity

  1. Like
    fughilli got a reaction from TivaFan2341426460014 in 3 new libraries: Arduino "Servo" library clone, ultrasonic ranger library, data smoothing library   
    Hello all!
     
    I've got three new libraries to share with you!
     
    They are:
     
    An Arduino "Servo" library clone (StellarPad):
     
    Duplicates all of the functionality of the Arduino "Servo" library. Fully compatible with all existing sketches that use the Arduino "Servo" library. Based upon the Eigendreams servo library posted here a while back. Supports 8 servos as-is. Can be modified to do a heck of a lot more, but that is up to you to incorporate (at least for now -- update to come soon).
     
    An ultrasonic rangefinder library (StellarPad, easily modifiable to work with other Energia devices):
     
    Designed for the HC-SR04 rangefinder, about $5 on e-bay. Should also work with some other rangefinders, but I have not tested any others. That is, again, up to you (for now). Supports as many of them as you can fit on your I/O.
     
    A data smoother library (All Energia/Arduino supported devices):
     
    Inspired by the Arduino "smoothing" example by Tom Igoe. Allows the creation of "Smoother" objects that calculate running averages of raw data. "Smoother" is a template class and can be instantiated to work with int's, float's, long's, etc.
     
    All three libraries have their own examples, and the following is an example that incorporates the functionality of all of them (No comments, sorry! This one is pretty self-explanatory. See the library-specific examples for more details):
    #include <SonicRanger.h> #include <Smoother.h> #include <Servo.h> SonicRanger sr; Servo servo; Smoother<int, 10> ssmoother; boolean smoothing = false; void setup () { sr.attach(PE_1, PE_2); servo.attach(PF_1); pinMode(BLUE_LED, OUTPUT); digitalWrite(BLUE_LED, LOW); pinMode(PUSH2, INPUT); attachInterrupt(PUSH2, buttonISR, FALLING); } void loop () { float distance = sr.getDistance(INCHES); int processedDistance; if(distance > 0) { processedDistance = (int)(distance * 1000); processedDistance = constrain(processedDistance, 2000, 12000); if(smoothing) { ssmoother.pushValue(processedDistance); processedDistance = ssmoother.pullValue(); } servo.write(map(processedDistance, 2000, 12000, 0, 180)); } delay(50); } void buttonISR () { smoothing = !smoothing; digitalWrite(BLUE_LED, smoothing); } Video demonstration of the above example sketch:
     
    http://youtu.be/IViqIa4Rl9Y
     
    Enjoy!
     
    -K/Fughilli
    SonicRanger.zip
    Smoother.zip
    Servo.zip
  2. Like
    fughilli got a reaction from vladn in 3 new libraries: Arduino "Servo" library clone, ultrasonic ranger library, data smoothing library   
    Hello all!
     
    I've got three new libraries to share with you!
     
    They are:
     
    An Arduino "Servo" library clone (StellarPad):
     
    Duplicates all of the functionality of the Arduino "Servo" library. Fully compatible with all existing sketches that use the Arduino "Servo" library. Based upon the Eigendreams servo library posted here a while back. Supports 8 servos as-is. Can be modified to do a heck of a lot more, but that is up to you to incorporate (at least for now -- update to come soon).
     
    An ultrasonic rangefinder library (StellarPad, easily modifiable to work with other Energia devices):
     
    Designed for the HC-SR04 rangefinder, about $5 on e-bay. Should also work with some other rangefinders, but I have not tested any others. That is, again, up to you (for now). Supports as many of them as you can fit on your I/O.
     
    A data smoother library (All Energia/Arduino supported devices):
     
    Inspired by the Arduino "smoothing" example by Tom Igoe. Allows the creation of "Smoother" objects that calculate running averages of raw data. "Smoother" is a template class and can be instantiated to work with int's, float's, long's, etc.
     
    All three libraries have their own examples, and the following is an example that incorporates the functionality of all of them (No comments, sorry! This one is pretty self-explanatory. See the library-specific examples for more details):
    #include <SonicRanger.h> #include <Smoother.h> #include <Servo.h> SonicRanger sr; Servo servo; Smoother<int, 10> ssmoother; boolean smoothing = false; void setup () { sr.attach(PE_1, PE_2); servo.attach(PF_1); pinMode(BLUE_LED, OUTPUT); digitalWrite(BLUE_LED, LOW); pinMode(PUSH2, INPUT); attachInterrupt(PUSH2, buttonISR, FALLING); } void loop () { float distance = sr.getDistance(INCHES); int processedDistance; if(distance > 0) { processedDistance = (int)(distance * 1000); processedDistance = constrain(processedDistance, 2000, 12000); if(smoothing) { ssmoother.pushValue(processedDistance); processedDistance = ssmoother.pullValue(); } servo.write(map(processedDistance, 2000, 12000, 0, 180)); } delay(50); } void buttonISR () { smoothing = !smoothing; digitalWrite(BLUE_LED, smoothing); } Video demonstration of the above example sketch:
     
    http://youtu.be/IViqIa4Rl9Y
     
    Enjoy!
     
    -K/Fughilli
    SonicRanger.zip
    Smoother.zip
    Servo.zip
  3. Like
    fughilli got a reaction from MarkMartagon in 3 new libraries: Arduino "Servo" library clone, ultrasonic ranger library, data smoothing library   
    Hello all!
     
    I've got three new libraries to share with you!
     
    They are:
     
    An Arduino "Servo" library clone (StellarPad):
     
    Duplicates all of the functionality of the Arduino "Servo" library. Fully compatible with all existing sketches that use the Arduino "Servo" library. Based upon the Eigendreams servo library posted here a while back. Supports 8 servos as-is. Can be modified to do a heck of a lot more, but that is up to you to incorporate (at least for now -- update to come soon).
     
    An ultrasonic rangefinder library (StellarPad, easily modifiable to work with other Energia devices):
     
    Designed for the HC-SR04 rangefinder, about $5 on e-bay. Should also work with some other rangefinders, but I have not tested any others. That is, again, up to you (for now). Supports as many of them as you can fit on your I/O.
     
    A data smoother library (All Energia/Arduino supported devices):
     
    Inspired by the Arduino "smoothing" example by Tom Igoe. Allows the creation of "Smoother" objects that calculate running averages of raw data. "Smoother" is a template class and can be instantiated to work with int's, float's, long's, etc.
     
    All three libraries have their own examples, and the following is an example that incorporates the functionality of all of them (No comments, sorry! This one is pretty self-explanatory. See the library-specific examples for more details):
    #include <SonicRanger.h> #include <Smoother.h> #include <Servo.h> SonicRanger sr; Servo servo; Smoother<int, 10> ssmoother; boolean smoothing = false; void setup () { sr.attach(PE_1, PE_2); servo.attach(PF_1); pinMode(BLUE_LED, OUTPUT); digitalWrite(BLUE_LED, LOW); pinMode(PUSH2, INPUT); attachInterrupt(PUSH2, buttonISR, FALLING); } void loop () { float distance = sr.getDistance(INCHES); int processedDistance; if(distance > 0) { processedDistance = (int)(distance * 1000); processedDistance = constrain(processedDistance, 2000, 12000); if(smoothing) { ssmoother.pushValue(processedDistance); processedDistance = ssmoother.pullValue(); } servo.write(map(processedDistance, 2000, 12000, 0, 180)); } delay(50); } void buttonISR () { smoothing = !smoothing; digitalWrite(BLUE_LED, smoothing); } Video demonstration of the above example sketch:
     
    http://youtu.be/IViqIa4Rl9Y
     
    Enjoy!
     
    -K/Fughilli
    SonicRanger.zip
    Smoother.zip
    Servo.zip
  4. Like
    fughilli got a reaction from PTB in 3 new libraries: Arduino "Servo" library clone, ultrasonic ranger library, data smoothing library   
    Hello all!
     
    I've got three new libraries to share with you!
     
    They are:
     
    An Arduino "Servo" library clone (StellarPad):
     
    Duplicates all of the functionality of the Arduino "Servo" library. Fully compatible with all existing sketches that use the Arduino "Servo" library. Based upon the Eigendreams servo library posted here a while back. Supports 8 servos as-is. Can be modified to do a heck of a lot more, but that is up to you to incorporate (at least for now -- update to come soon).
     
    An ultrasonic rangefinder library (StellarPad, easily modifiable to work with other Energia devices):
     
    Designed for the HC-SR04 rangefinder, about $5 on e-bay. Should also work with some other rangefinders, but I have not tested any others. That is, again, up to you (for now). Supports as many of them as you can fit on your I/O.
     
    A data smoother library (All Energia/Arduino supported devices):
     
    Inspired by the Arduino "smoothing" example by Tom Igoe. Allows the creation of "Smoother" objects that calculate running averages of raw data. "Smoother" is a template class and can be instantiated to work with int's, float's, long's, etc.
     
    All three libraries have their own examples, and the following is an example that incorporates the functionality of all of them (No comments, sorry! This one is pretty self-explanatory. See the library-specific examples for more details):
    #include <SonicRanger.h> #include <Smoother.h> #include <Servo.h> SonicRanger sr; Servo servo; Smoother<int, 10> ssmoother; boolean smoothing = false; void setup () { sr.attach(PE_1, PE_2); servo.attach(PF_1); pinMode(BLUE_LED, OUTPUT); digitalWrite(BLUE_LED, LOW); pinMode(PUSH2, INPUT); attachInterrupt(PUSH2, buttonISR, FALLING); } void loop () { float distance = sr.getDistance(INCHES); int processedDistance; if(distance > 0) { processedDistance = (int)(distance * 1000); processedDistance = constrain(processedDistance, 2000, 12000); if(smoothing) { ssmoother.pushValue(processedDistance); processedDistance = ssmoother.pullValue(); } servo.write(map(processedDistance, 2000, 12000, 0, 180)); } delay(50); } void buttonISR () { smoothing = !smoothing; digitalWrite(BLUE_LED, smoothing); } Video demonstration of the above example sketch:
     
    http://youtu.be/IViqIa4Rl9Y
     
    Enjoy!
     
    -K/Fughilli
    SonicRanger.zip
    Smoother.zip
    Servo.zip
  5. Like
    fughilli got a reaction from jcoronel in 3 new libraries: Arduino "Servo" library clone, ultrasonic ranger library, data smoothing library   
    Hello all!
     
    I've got three new libraries to share with you!
     
    They are:
     
    An Arduino "Servo" library clone (StellarPad):
     
    Duplicates all of the functionality of the Arduino "Servo" library. Fully compatible with all existing sketches that use the Arduino "Servo" library. Based upon the Eigendreams servo library posted here a while back. Supports 8 servos as-is. Can be modified to do a heck of a lot more, but that is up to you to incorporate (at least for now -- update to come soon).
     
    An ultrasonic rangefinder library (StellarPad, easily modifiable to work with other Energia devices):
     
    Designed for the HC-SR04 rangefinder, about $5 on e-bay. Should also work with some other rangefinders, but I have not tested any others. That is, again, up to you (for now). Supports as many of them as you can fit on your I/O.
     
    A data smoother library (All Energia/Arduino supported devices):
     
    Inspired by the Arduino "smoothing" example by Tom Igoe. Allows the creation of "Smoother" objects that calculate running averages of raw data. "Smoother" is a template class and can be instantiated to work with int's, float's, long's, etc.
     
    All three libraries have their own examples, and the following is an example that incorporates the functionality of all of them (No comments, sorry! This one is pretty self-explanatory. See the library-specific examples for more details):
    #include <SonicRanger.h> #include <Smoother.h> #include <Servo.h> SonicRanger sr; Servo servo; Smoother<int, 10> ssmoother; boolean smoothing = false; void setup () { sr.attach(PE_1, PE_2); servo.attach(PF_1); pinMode(BLUE_LED, OUTPUT); digitalWrite(BLUE_LED, LOW); pinMode(PUSH2, INPUT); attachInterrupt(PUSH2, buttonISR, FALLING); } void loop () { float distance = sr.getDistance(INCHES); int processedDistance; if(distance > 0) { processedDistance = (int)(distance * 1000); processedDistance = constrain(processedDistance, 2000, 12000); if(smoothing) { ssmoother.pushValue(processedDistance); processedDistance = ssmoother.pullValue(); } servo.write(map(processedDistance, 2000, 12000, 0, 180)); } delay(50); } void buttonISR () { smoothing = !smoothing; digitalWrite(BLUE_LED, smoothing); } Video demonstration of the above example sketch:
     
    http://youtu.be/IViqIa4Rl9Y
     
    Enjoy!
     
    -K/Fughilli
    SonicRanger.zip
    Smoother.zip
    Servo.zip
  6. Like
    fughilli reacted to energia in Scheduler/Chron library -- experimental!   
    Great work @@fughilli. 
  7. Like
    fughilli got a reaction from bluehash in Scheduler/Chron library -- experimental!   
    Hello all!
     
    I've been on a sort of coding binge lately... and so a new library has been born!
     
    This one will come with basically no manual and no explanation, other than:
    It lets you schedule things to happen at specific times.
    It is timer interrupt-driven.
    It works with the StellarPad.
    It requires that you make some modifications to startup_gcc.c and (at least, in my case) to Energia.h, main.c, and lm4fcpp.ld.
     
    All the files are attached below.
     
    Be warned that this is an early prototype, and that though it works (as far as I can tell) now, it will probably undergo some pretty significant changes in the future.
     
    Three examples are included.
     
    Have fun!
     
    -K/fughilli
    Chronos.zip
    modified_things.zip
  8. Like
    fughilli got a reaction from reaper7 in Scheduler/Chron library -- experimental!   
    Hello all!
     
    I've been on a sort of coding binge lately... and so a new library has been born!
     
    This one will come with basically no manual and no explanation, other than:
    It lets you schedule things to happen at specific times.
    It is timer interrupt-driven.
    It works with the StellarPad.
    It requires that you make some modifications to startup_gcc.c and (at least, in my case) to Energia.h, main.c, and lm4fcpp.ld.
     
    All the files are attached below.
     
    Be warned that this is an early prototype, and that though it works (as far as I can tell) now, it will probably undergo some pretty significant changes in the future.
     
    Three examples are included.
     
    Have fun!
     
    -K/fughilli
    Chronos.zip
    modified_things.zip
  9. Like
    fughilli got a reaction from energia in Scheduler/Chron library -- experimental!   
    Hello all!
     
    I've been on a sort of coding binge lately... and so a new library has been born!
     
    This one will come with basically no manual and no explanation, other than:
    It lets you schedule things to happen at specific times.
    It is timer interrupt-driven.
    It works with the StellarPad.
    It requires that you make some modifications to startup_gcc.c and (at least, in my case) to Energia.h, main.c, and lm4fcpp.ld.
     
    All the files are attached below.
     
    Be warned that this is an early prototype, and that though it works (as far as I can tell) now, it will probably undergo some pretty significant changes in the future.
     
    Three examples are included.
     
    Have fun!
     
    -K/fughilli
    Chronos.zip
    modified_things.zip
  10. Like
    fughilli reacted to bluehash in 3 new libraries: Arduino "Servo" library clone, ultrasonic ranger library, data smoothing library   
    Lovely. Thank for sharing!
    If you would like to test some sensors, let me know. I'll see if I can sponsor you some hardware.
  11. Like
    fughilli got a reaction from gmtii in 3 new libraries: Arduino "Servo" library clone, ultrasonic ranger library, data smoothing library   
    Hello all!
     
    I've got three new libraries to share with you!
     
    They are:
     
    An Arduino "Servo" library clone (StellarPad):
     
    Duplicates all of the functionality of the Arduino "Servo" library. Fully compatible with all existing sketches that use the Arduino "Servo" library. Based upon the Eigendreams servo library posted here a while back. Supports 8 servos as-is. Can be modified to do a heck of a lot more, but that is up to you to incorporate (at least for now -- update to come soon).
     
    An ultrasonic rangefinder library (StellarPad, easily modifiable to work with other Energia devices):
     
    Designed for the HC-SR04 rangefinder, about $5 on e-bay. Should also work with some other rangefinders, but I have not tested any others. That is, again, up to you (for now). Supports as many of them as you can fit on your I/O.
     
    A data smoother library (All Energia/Arduino supported devices):
     
    Inspired by the Arduino "smoothing" example by Tom Igoe. Allows the creation of "Smoother" objects that calculate running averages of raw data. "Smoother" is a template class and can be instantiated to work with int's, float's, long's, etc.
     
    All three libraries have their own examples, and the following is an example that incorporates the functionality of all of them (No comments, sorry! This one is pretty self-explanatory. See the library-specific examples for more details):
    #include <SonicRanger.h> #include <Smoother.h> #include <Servo.h> SonicRanger sr; Servo servo; Smoother<int, 10> ssmoother; boolean smoothing = false; void setup () { sr.attach(PE_1, PE_2); servo.attach(PF_1); pinMode(BLUE_LED, OUTPUT); digitalWrite(BLUE_LED, LOW); pinMode(PUSH2, INPUT); attachInterrupt(PUSH2, buttonISR, FALLING); } void loop () { float distance = sr.getDistance(INCHES); int processedDistance; if(distance > 0) { processedDistance = (int)(distance * 1000); processedDistance = constrain(processedDistance, 2000, 12000); if(smoothing) { ssmoother.pushValue(processedDistance); processedDistance = ssmoother.pullValue(); } servo.write(map(processedDistance, 2000, 12000, 0, 180)); } delay(50); } void buttonISR () { smoothing = !smoothing; digitalWrite(BLUE_LED, smoothing); } Video demonstration of the above example sketch:
     
    http://youtu.be/IViqIa4Rl9Y
     
    Enjoy!
     
    -K/Fughilli
    SonicRanger.zip
    Smoother.zip
    Servo.zip
  12. Like
    fughilli got a reaction from bluehash in 3 new libraries: Arduino "Servo" library clone, ultrasonic ranger library, data smoothing library   
    Hello all!
     
    I've got three new libraries to share with you!
     
    They are:
     
    An Arduino "Servo" library clone (StellarPad):
     
    Duplicates all of the functionality of the Arduino "Servo" library. Fully compatible with all existing sketches that use the Arduino "Servo" library. Based upon the Eigendreams servo library posted here a while back. Supports 8 servos as-is. Can be modified to do a heck of a lot more, but that is up to you to incorporate (at least for now -- update to come soon).
     
    An ultrasonic rangefinder library (StellarPad, easily modifiable to work with other Energia devices):
     
    Designed for the HC-SR04 rangefinder, about $5 on e-bay. Should also work with some other rangefinders, but I have not tested any others. That is, again, up to you (for now). Supports as many of them as you can fit on your I/O.
     
    A data smoother library (All Energia/Arduino supported devices):
     
    Inspired by the Arduino "smoothing" example by Tom Igoe. Allows the creation of "Smoother" objects that calculate running averages of raw data. "Smoother" is a template class and can be instantiated to work with int's, float's, long's, etc.
     
    All three libraries have their own examples, and the following is an example that incorporates the functionality of all of them (No comments, sorry! This one is pretty self-explanatory. See the library-specific examples for more details):
    #include <SonicRanger.h> #include <Smoother.h> #include <Servo.h> SonicRanger sr; Servo servo; Smoother<int, 10> ssmoother; boolean smoothing = false; void setup () { sr.attach(PE_1, PE_2); servo.attach(PF_1); pinMode(BLUE_LED, OUTPUT); digitalWrite(BLUE_LED, LOW); pinMode(PUSH2, INPUT); attachInterrupt(PUSH2, buttonISR, FALLING); } void loop () { float distance = sr.getDistance(INCHES); int processedDistance; if(distance > 0) { processedDistance = (int)(distance * 1000); processedDistance = constrain(processedDistance, 2000, 12000); if(smoothing) { ssmoother.pushValue(processedDistance); processedDistance = ssmoother.pullValue(); } servo.write(map(processedDistance, 2000, 12000, 0, 180)); } delay(50); } void buttonISR () { smoothing = !smoothing; digitalWrite(BLUE_LED, smoothing); } Video demonstration of the above example sketch:
     
    http://youtu.be/IViqIa4Rl9Y
     
    Enjoy!
     
    -K/Fughilli
    SonicRanger.zip
    Smoother.zip
    Servo.zip
×
×
  • Create New...