<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Pete and all,<div><br></div><div>I have been working on a GPRS-based data logger which uploads data to Xively.  </div><div><br></div><div><a href="https://xively.com/feeds/1602746142">Here is the stream</a> I have been testing - notice you can capture location data as well.</div><div><br></div><div>With Adafruit’s recently <a href="https://www.adafruit.com/product/1946">released GPRS modem</a> and Sparkfun’s <a href="https://data.sparkfun.com">new data service</a>, there are exciting new options for collecting and publishing data from distributed sensors using the cellular network.</div><div><br></div><div>If that is interesting to anyone, happy to demonstrate and share the code.</div><div><br></div><div>Thanks,</div><div><br></div><div>Chip</div><div><br></div><div><br><div><div>On Jul 31, 2014, at 9:08 PM, <a href="mailto:triembed-request@triembed.org">triembed-request@triembed.org</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Send TriEmbed mailing list submissions to<br><span class="Apple-tab-span" style="white-space:pre">    </span><a href="mailto:triembed@triembed.org">triembed@triembed.org</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br><span class="Apple-tab-span" style="white-space:pre">       </span>http://mail.triembed.org/mailman/listinfo/triembed_triembed.org<br>or, via email, send a message with subject or body 'help' to<br><span class="Apple-tab-span" style="white-space:pre">     </span>triembed-request@triembed.org<br><br>You can reach the person managing the list at<br><span class="Apple-tab-span" style="white-space:pre">    </span>triembed-owner@triembed.org<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of TriEmbed digest..."<br><br><br>Today's Topics:<br><br>   1. looking for a talk for August 11th/NCSU mtg & also somebody<br>      to record it (Pete Soper)<br>   2. Re: IR sensor vs trigger (The MacDougals)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Thu, 31 Jul 2014 21:24:33 -0400<br>From: Pete Soper <pete@soper.us><br>To: Triangle Embedded Computing Discussion <triembed@triembed.org><br>Subject: [TriEmbed] looking for a talk for August 11th/NCSU mtg & also<br><span class="Apple-tab-span" style="white-space:pre">       </span>somebody to record it<br>Message-ID: <53DAEC51.8010109@soper.us><br>Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br><br>Anybody interested?<br><br>-Pete<br><br><br><br><br><br>------------------------------<br><br>Message: 2<br>Date: Thu, 31 Jul 2014 22:07:39 -0400<br>From: "The MacDougals" <paulmacd@acm.org><br>To: "'Joe Fair'" <joe@fairanswers.com><br>Cc: triembed@triembed.org<br>Subject: Re: [TriEmbed] IR sensor vs trigger<br>Message-ID: <00ae01cfad2d$60150e80$203f2b80$@acm.org><br>Content-Type: text/plain; charset="utf-8"<br><br>The Tiny chips support pin change interrupts on all pins.  You surely do not need two chips.<br><br>I would definitely get rid of the 1 second timeout.  I use the interrupt to be sure that I do not<br><br>miss a pulse on a pin.  If the pulses are long enough, then you can just poll and not worry about<br><br>using interrupts.<br><br><br><br>Here are fragments of code from my rain gauge that sleeps most of the time.  It wakes up<br><br>on the rain sensor changing state or on a button press.  If you want more details, let me know.<br><br><br><br>---> Paul<br><br><br><br><br><br>#if defined(__AVR_ATtiny84__)<br><br>#include <avr/interrupt.h><br><br>#endif<br><br><br><br>const uint8_t SW_PIN  = 4;<br><br>const uint8_t RAIN_PIN = 8;    // PCINT0<br><br><br><br>volatile uint8_t rain_pin_state = LOW;// does not matter what it is initialized to<br><br>volatile uint8_t rain_count = 0;<br><br><br><br>#if defined(__AVR_ATtiny84__)<br><br>// PA4 handler<br><br>ISR(PCINT0_vect) {<br><br>    // just wake up<br><br>}<br><br><br><br>// PB2 handler<br><br>ISR(PCINT1_vect) {<br><br>    // see if the rain gauge has tipped<br><br>    uint8_t save_rain_pin_state = rain_pin_state;<br><br>    if (save_rain_pin_state != (rain_pin_state = digitalRead(RAIN_PIN)))<br><br>        rain_count++;<br><br>}<br><br>#endif<br><br><br><br>#ifndef cbi<br><br>#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))<br><br>#endif<br><br>#ifndef sbi<br><br>#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))<br><br>#endif<br><br><br><br>setup()<br><br>{<br><br>    pinMode(RAIN_PIN, INPUT_PULLUP);<br><br>    rain_pin_state = digitalRead(RAIN_PIN);<br><br><br><br>?<br><br>#if defined(__AVR_ATtiny84__)<br><br>    sei(); // Turn on interrupts<br><br>    // Pin interrupt setup for rain bucket<br><br>    sbi(GIMSK,5); // Enable pin change interrupt 1<br><br>    sbi(PCMSK1,2); // Allow pin changes on PB2<br><br>#endif<br><br>?<br><br>}<br><br><br><br>void loop()<br><br>{<br><br>    // we expect rain_count to be 0 or 1.  If it is more than 1, then it is likely a signal bounce<br><br>    if (rain_count) {<br><br>        ?<br><br>    }<br><br>}<br><br><br><br><br><br><br><br>From: TriEmbed [mailto:triembed-bounces@triembed.org] On Behalf Of Joe Fair<br>Sent: Thursday, July 31, 2014 7:15 PM<br>To: Jon Wolfe<br>Cc: triembed@triembed.org<br>Subject: Re: [TriEmbed] IR sensor vs trigger<br><br><br><br>I think you are right, they kind of each need a chip.  I was hoping to be smart enough to not to need more hardware. <br>Does the tiny sport two interrupts?  Or maybe i can tie them together?<br><br>I guess i need to learn more about days sheets, too.<br>Joe<br><br>On Jul 30, 2014 10:09 PM, "Jon Wolfe" <jonjwolfe@yahoo.com> wrote:<br><br>I agree with the others, it sounds like the trigger should get the interrupt.<br><br><br><br>Like Jeff said, you want your interrupt to execute in as short of a time as possible. One approach might be to just set a flag on trigger presses then process the action in the main loop. That could still leave you with 1 sec latency if you are detecting IR hits, which would probably be pretty noticeable.<br><br><br><br>I have never tried this on a tiny, but I'm making it a personal mission to find a use case for it, but you could use an RTOS, like http://www.femtoos.org/  Looks promising. I've used ChibiOS on Cortex M3/4's and found it pretty nice to work with, YMMV. <br><br><br><br>The other alternative approaches might be to try to reduce the 1 second detection loop. Or, to try to architect your own "cooperative multitasking" or coroutines. In short, write your detect loop so that instead of looping for 1 second, it just does a little bit of work and returns to the main loop, remembering where is was in the loop between each call. I use this approach a lot.<br><br><br><br>I will say that you should try to handle debouncing the trigger in hardware as much as you can. I've tried software debouncing mechanical encoders in interrupt driven routines, and I can attest that it is maddening.<br><br><br><br>Lastly, you *could* always just buy a separate tiny for the detection, but I have no ulterior motive or bias there ;)<br><br><br><br><br><br><br><br><br><br>  _____  <br><br>From: Joe Fair <joe@fairanswers.com><br>To: triembed@triembed.org <br>Sent: Saturday, July 26, 2014 4:09 PM<br>Subject: [TriEmbed] IR sensor vs trigger<br><br><br><br>Ok.  I'm pretty close on getting my home made laser tag with at tiny 85s going, but now i have a question about design.<br><br>The loop I'm using detects a trigger pull, then a hit on the sensors.  however, The pulse in function I'm using to sense IR ha a timeout of 1 second.  If there is no inbound signal it is only checking got a trigger pull once a second.<br><br>So i need to use an interrupt, but does it matter if i use one on the trigger pull or the ir sensor? <br><br>Joe<br><br><br>_______________________________________________<br>Triangle, NC Embedded Computing mailing list<br>TriEmbed@triembed.org<br>http://mail.triembed.org/mailman/listinfo/triembed_triembed.org<br>TriEmbed web site: http://TriEmbed.org <http://triembed.org/> <br><br><br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20140731/f0ad0fbc/attachment.html><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>TriEmbed mailing list<br>TriEmbed@triembed.org<br>http://mail.triembed.org/mailman/listinfo/triembed_triembed.org<br><br><br>------------------------------<br><br>End of TriEmbed Digest, Vol 14, Issue 37<br>****************************************<br></blockquote></div><br></div></body></html>