background preloader

Microcontroller tutorial series: AVR and Arduino timer interrupts

Microcontroller tutorial series: AVR and Arduino timer interrupts
Does your program seem like it’s trying to do too much at once? Are you using a lot of delay() or while() loops that are holding other things up? If so, your project is a good candidate to use timers. In this tutorial, we’ll discuss AVR and Arduino timers and how to use them to write better code. In our prior article, we covered interrupt basics and how to use external interrupts that are triggered by a pin change or similar event. Check it out if you’re looking to brush up on interrupts in general. This chapter moves on to timer interrupts and talks about their applications in Arduino projects or custom AVR circuits. What is a timer? You’re probably familiar with the general concept of a timer: something used to measure a given time interval. The beauty of timers is that just like external interrupts, they run asynchronously, or independently from your main program. For example, say you’re building a security robot. How do timers work? Our timer resolution is one millionth of a second.

CommentReparer.com - Apprenez à tout réparer Tout réparer (ou presque) | SUV [sens & utilités en vrac] A l’heure où la grogne contre l’obsolescence programmée devient de plus en plus audible, on me demande souvent comment réparer des produits : ces chaussures irréparables, ces faux contacts dans les écouteurs si frustrants. En tant que passionnée du hack, de la réparation, et du détournement, je n’avais pas de solution pour bien des objets jusqu’à ce que je découvre Sugru, une sorte de pâte à modeler en silicone qui permet de réparer tout ou presque. Cette très belle vidéo de Do the Green Thing donne une petite idée des portes de la créativité qui s’ouvrent à vous. The Joy of Fix from Do the Green Thing on Vimeo. On peut réparer les roues usées de sa valise de voyage, un câble, et beaucoup d’autres choses encore : regardez cette vidéo où on vous fait – avec humour – une démonstration des choses que l’on peut faire. L’idée derrière ce produit: permettre à chacun de réparer et adapter les produits à leurs besoins. Vous ne savez pas comment faire? Une poignée cassée: une réparation discrète

Related: