background preloader

DS1307 RTC tutorial

AttachInterrupt Reference Language | Libraries | Comparison | Changes Description Specifies a named Interrupt Service Routine (ISR) to call when an interrupt occurs. Replaces any previous function that was attached to the interrupt. Most Arduino boards have two external interrupts: numbers 0 (on digital pin 2) and 1 (on digital pin 3). The Arduino Due board has powerful interrupt capabilities that allows you to attach an interrupt function on all available pins. Note Inside the attached function, delay() won't work and the value returned by millis() will not increment. Using Interrupts Interrupts are useful for making things happen automatically in microcontroller programs, and can help solve timing problems. About Interrupt Service Routines ISRs are special kinds of functions that have some unique limitations most other functions do not have. Generally, an ISR should be as short and fast as possible. Typically global variables are used to pass data between an ISR and the main program. Syntax Parameters none

Arduino Candygrabber I've seen a lot of ways to communicate to arduino over the net, but none of them could handle pushing back the messages from arduino to the client(you) in real time and vice versa. In this instructable you will learn how to connect to your arduino and control it over the net, set up a video stream, and how to control stuff with your arduino all in realtime. I'll try to show you on a concrete example how this could be done, but the code I used and wrote is going to be generic so you can use it for your projects. In this example my arduino is going to control a candy grabbing machine. So how should it work? I'll try to keep it online as long possible but my internet provider is a little quirky so if you can't connect please come back later. Seems complicated? UPDATE 2: I decided if I win the MakerBot to give it away to my Arduino comunity that started in Croatia.

Review – Texas Instruments TLC5940 16-channel LED driver IC Use the Texas Instruments TLC5940 16-Channel LED Driver IC with Arduino in Chapter 57 of our Arduino Tutorials. The first chapter is here, the complete series is detailed here. Introduction Today we are going to examine the Texas Instruments TLC5940 16-channel LED driver IC. The TLC5940 is available in the DIP version above, and also surface-mount. During this tutorial we’ll explain how to control one or more TLC5940 ICs with LEDs and also look at controlling servos. Build a TLC5940 demonstration circuit The following circuit is the minimum required to control sixteen LEDs from your Arduino or compatible. An Arduino Uno or compatible board16 normal, everyday LEDs that can have a forward current of up to 20 mAa 2 kΩ resistor (give or take 10%)a 0.1uF ceramic and a 4.7uF electrolytic capacitor Take note of the LED orientation – and remember the TLC5940 is a common-anode LED driver – so all the LED anodes are connected together and then to 5V: R = 39.06 / Imax R = 39.06 / 0.02 = 1803 Ohms.

Thats it! The basic materials and tools you will need are: A metal clad tool case (Maplin, B&Q, tool shops - see photos). Perspex sheet 3mm thick and the size of the inner rim of the lip of your box (see photo later). M3 Nuts, bolts and washers (20 or so will cover it). Black card sheet (A3 size, Staples). 2x UV-A tubes - not blacklight tubes, you need to get the right ones (Rapid, CPC, Specialist). Tube "U" clips to fit the tubes - metal sprung type. Mains rated switch (Maplin, Rapid, CPC etc...). Mains flex 3M or so, 3 core 5A (to use whole and stripped into conductors). Heatshrink tubing slightly larger than the wiring you will use (inner conductors of mains flex). Ring terminals. 3A Terminal block or "chocstrip" Mains strain relief cable gland (Maplin, electrical supplier) to fit your mains cable. Various short screws, pan head and countersunk self tapping. Sticky tape 2 small blocks of wood 1"x1" Mirrored card/plastic or tin-foil. Tools: Drill. Drill bits. Soldering Iron. Solder. Crimp tool for ring terminal.

Ready, Set, Oscillate! The Fastest Way to Change Arduino Pins « The Mind of Bill Porter There are many ways to change an output pin. The way we know and love is the famous digitalWrite() function. (Spoiler: Want a faster digitalWrite? But even the Arduino Reference claims that it is not the most efficient. I ran some tests to find out. The estimated CPU cycles is calculated from ½ the waveform period measured divided by the period of 16Mhz, since it takes two write operations to complete a full period in a waveform. The 3 methods I tested were digitalWrite(pin, LOW); digitalWrite(pin, HIGH);CLR(PORTB, 0) ; SET(PORTB, 0);PORTB |= _BV(0); PORTB &= ~(_BV(0)); The macros used: #define CLR(x,y) (x&=(~(1<<y))) #define SET(x,y) (x|=(1<<y)) #define _BV(bit) (1 << (bit)) The results As you can see, digitalWrite takes around 56 cycles to complete, while direct Port addressing takes 2 cycles. Next I tested just flipping a pin. digitalWrite(pin, ! #define sbi(port,bit) (port)|=(1<<(bit)) Wow, the Arduino method takes a whopping 121 cycles to flip a pin!

_posts/2011-09-04-servo-photoresistor-arduino.md at master · nrdufour/nemoworld.info DIY Planet : Made in Fr - page 4 Un petit billet pour vous donner des nouvelles de Bleuette... Alimentation Pour fonctionner correctement, Bleuette à besoin d'une tension de 5V@1A pour alimenter son cerveau (un RaspberryPi) et d'une autre tension de 6V@3A pour alimenter les servos et la guirlande de led. Le développement d'une seconde carte fille permettant de générer les alimentations est prévue mais pour le moment, j'ai fait au plus simple, ainsi, pour le 6V, j'ai branché en parallèle 2 modules régulateurs de tension à découpage facilement trouvable sur le net, notamment, sur DealExtreme, ce sont des modules très pratiques que j'utilise assez souvent, ils sont capables de débiter 3A en pointe, mis en parallèle, nous avons donc théoriquement 6A, c'est amplement suffisant pour Bleuette qui comme dit plus haut doit avoir besoin de 3A maximum. Note: Concernant la mise en parallèle des régulateurs à découpage, prenez garde à parfaitement bien régler la même tension sur les 2 modules à l'aide d'un multimètre fiable. Divers :

openMaterials | DIY smart materials Arduino Examples Arduino Examples These examples are designed to demonstrate how to use our modules with the Arduino. The Arduino's hardware serial port is not used to connect to our modules, which keeps it available to the USB port. The Arduino uses 7bit I2C addresses, and our own documentation uses 8bit addresses. CMPS03 Magnetic CompassThis uses the I2C bus to connect the Arduino to the CMPS03. CMPS10 Tilt Compensated Magnetic Compass This uses the I2C bus to connect the Arduino to the CMPS09. SRF01 Ultrasonic Ranger The SRF01 uses a single pin for both serial input and output. SRF02, SRF08, SRF10, SRF235 Ultrasonic RangersThe SRF02, SRF08, SRF10 and SRF235 all use the same I2C interface. SRF485WPR Ultrasonic RangerUsing an ST485 for communication this example finds the address of an SRF485 and reads the range back from it. SRF04 and SRF05 Ultrasonic Ranger This example reads the range from the SRF04 and displays it in the arduino serial monitor. RLY08 Relay Module A simple example.

Related: