Show Posts
Pages: 1 ... 7 8 [9] 10 11
121  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: How did you learn programming the Arduino? on: June 29, 2009, 02:42:19 pm
I would go to http://arduino.cc/en/Tutorial/HomePage and start with the Blink example, and work your way down.  Be sure you understand why everything happens before heading on to the next one.
122  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Button Release detection? on: July 07, 2009, 09:58:06 pm
Assuming your button pulls an input pin low when you push the button, the following should work:

Code:
 currentState = digitalRead(switchPin);
  
  if (currentState != lastState) {
    if (currentState == LOW) {
      // button down event
    }
    
    if (currentState == HIGH) {
      // button up event
    }
    
    // debounce
    delay(50);
  }
  
  lastState = currentState;
123  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Standalone - how to interface? on: June 25, 2009, 03:37:02 pm
There's a really great tutorial on stand alone arduinos here:

http://www.imagearts.ryerson.ca/sdaniels/physcomp/tutorials/Arduino_standalone/ard_hack.html

And a specific page about serial connections here:

http://www.imagearts.ryerson.ca/sdaniels/physcomp/tutorials/arduino_serial/ard_serial.html

He's not using a MAX chip I don't think, it looks like a different one, but connections to the atmega should be the same.
124  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Standalone - how to interface? on: June 24, 2009, 04:21:40 pm
Are you looking for a long-term serial connection to the computer, or just short term for programming / debugging?
125  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Led chase help on: June 18, 2009, 10:00:23 pm
TimedAction is really useful, I've used it in a couple of places.  I like the idea of going full OO on simple stuff like this.

Sorry for my true/false error, I've been doing too much PHP lately.  I usually use just int blah = 0/1 for true false.  I will correct the original post if I can...
126  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Led chase help on: June 18, 2009, 03:20:39 pm
Oops, in checkButtonPressed() it should return TURE or FALSE, not true or false.
Ignore that, Mike has it correct below.

In your loop() function, you have too many opening {  You can delete the for loop at the top of loop(), since that same logic happens inside of loopLights().

127  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Led chase help on: June 18, 2009, 12:53:26 pm
Expanding on Mike's idea, I would try something like this.  Note if you left this on a really really long time the millis() function rolls over after a few days.  This isn't a full sketch, there would have to be a bunch of stuff in setup()

boolean running = false;
int finish = 0;
boolean buttonPressed = false;
int timer = 100;

loop()
{

  // See if we pushed the button
  buttonPressed = checkButtonPressed();
  
  // If we pushed the button, and we're not already running, start
  // running, and set an end time
  if (buttonPressed && !running)
  {
    running = true;
    finish = millis() + 60000;
  }
  
  // See if we should stop running
  if (running && ( finish < millis() ))
  {
    running = false;
    finish = 0;
  }
  
  // If we're running, loop through lights once
  if (running)
  {
    loopLights()
  }

}

// Modify http://arduino.cc/en/Tutorial/Loop to suit
loopLights()
{
  int i;

    for (i = 0; i < num_pins; i++)     // loop through each pin...
    {  
      digitalWrite(pins, HIGH);   // turning it on,
      delay(timer);                  // pausing,
      digitalWrite(pins, LOW);    // and turning it off.
    }
}

// Detect a button press
checkButtonPressed()
{
  // figure out how to detect a button press then
  return true;
  // or
  return false;
}
128  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Starter kit on: June 16, 2009, 05:27:53 pm
I'd start off by seeing if there's a local electronics store.  The more you can buy locally the better in my opinion.  If you can't, Seeedstudio has a decent starter pack that can be ordered with or without an Arduino board.

http://www.seeedstudio.com/depot/super-seeeduino-catalyst-pack-p-257.html

Scroll to the bottom and choose the trimmed version.
129  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Buttons to run applescript on: June 08, 2009, 06:43:02 pm
There's an applescript proxy tool that will listen to a serial port, and send applescript commands:

http://tinker.it/now/2007/04/26/control-your-mac-from-arduino-the-easy-way/
130  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: smaller chip and internal oscillator? on: May 26, 2009, 09:46:29 pm
I've had pretty good luck using the smaller AVRs also.  The ATTiny13 / 25 / 45 series is an 8 pin DIP, and uses the same underlying avr-gcc that Arduino is built on.  The smaller chips are less powerful, and have less program space, so you're limited in what you can borrow from the arduino environment.  It works great, but it is definitely more of a challenge without all the niceness of the Arduino libraries.

If you already have a burner for the ATmega168 chips, that same burner will work on the tinys.

http://www.flickr.com/photos/fischco/3516213976/in/set-72157617823152037/
131  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Minimal Arduino? on: June 02, 2009, 12:03:06 am
I was actually playing around with just this project to try and learn Eagle some.  I followed the sparkfun tutorials, and the part is actually an atmega8 that I just renamed since the pinout is the same.  The basic layout I used is from:

http://www.imagearts.ryerson.ca/sdaniels/physcomp/tutorials/Arduino_standalone/ard_hack.html

I just left off the power supply and reset switch.

Here's what I came up with.





Page 5 of the RBBB PDF has a more complete schematic also:

http://www.moderndevice.com/Docs/RBBB_Instructions_04.pdf
132  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: How do you make Atemega168 standalone??? on: June 04, 2009, 03:28:34 pm
Other's have also mentioned that it is possible to run the 168 without a crystal+caps/resonator if you burn the Lilypad bootloader, and are ok running on the internal 8MHz clock.
133  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: How do you make Atemega168 standalone??? on: June 04, 2009, 02:06:54 pm
Google Says:

site:arduino.cc arduino standalone

Links I've found useful:

http://www.arduino.cc/playground/Learning/AtmegaStandalone
http://www.arduino.cc/en/Main/StandaloneAssembly
http://www.imagearts.ryerson.ca/sdaniels/physcomp/tutorials/Arduino_standalone/ard_hack.html
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234192721
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1239733868
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1240701133
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1239733868
134  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Standard libraries on: May 24, 2009, 03:21:27 pm
Should be the same os normal C versions, just #include <string.h>
135  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Deploying Arduino project cheaply? on: May 14, 2009, 09:11:15 am
There's a bunch of setups that will let you program the chip in an Arduino, then pull the chip out and plug it into a stand alone unit:

http://spiffie.org/kits/duinostamp/

You could get a cheap serial kit and just not build out the serial connection
http://www.nkcelectronics.com/arduino-board-serial-v20-complete-k.html

You could put together your own board with whatever parts you want
http://www.imagearts.ryerson.ca/sdaniels/physcomp/tutorials/Arduino_standalone/ard_hack.html

Seeeduinos (the 1.1v) are on sale at NKC for $16 right now
http://www.nkcelectronics.com/seeeduino-fully-assembled--arduino-compatible.html

It really depends on the application.  If you aren't using 168/328 specific features, you can even drop down to another ATxxx chip and get an even smaller package (programming those can be a bit harder).
Pages: 1 ... 7 8 [9] 10 11