Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: Running a loop once (Beginner talk!) on: January 26, 2011, 07:13:06 am
Code:
int lightPin = 0;
int motorPin = 9;
boolean trigger=false;

void setup()
{
 pinMode(motorPin, OUTPUT);
 pinMode(lightPin, INPUT);
}

void loop() {
   if (analogRead(lightPin) > 300 && !trigger) {    
      digitalWrite(motorPin, HIGH);
      delay(2000);
      digitalWrite(motorPin, LOW);
      trigger=true;
        }
   if (analogRead(lightPin) < 300) {
      digitalWrite(motorPin, LOW);
      trigger=false;
        }
  }

 smiley-lol  smiley-wink
I would do !trigger, much cleaner.
Edit: hm no bold tags in quote...
2  Forum 2005-2010 (read only) / Troubleshooting / Re: [ISP] Arduino without bootloader on: August 24, 2009, 03:56:39 am
Ok i got it 'to work' now. I added my USBasp to Arduino IDE. I then Burned the Bootloader from the menu to get all the Arduino settings (fuses etc).

Also changed Upload.using to USBasp instead of Bootloader. Works fine.

BUT something really wierd. Blink example does not work. But Melody, and BlinkWithOutDelay, work perfect! WTH.....

(Also i find it wierd that the avr still works when the bootloader is gone, but the fuses say 'boot vector enabled, blabla')
3  Forum 2005-2010 (read only) / Troubleshooting / [ISP] Arduino without bootloader on: August 23, 2009, 08:55:47 am
I made a small board to flash my ATMEGA168 chip (with a 16Mhz crystal). Flashing works fine with my USBasp programmer.

I did a Chip Erase, then set the fuses to Low: 0xFF (external crystal), High: 0xDF (only SPI enabled), Extended: 0xF9, and Lock bits to 0xFF (or 0x3F) (No mem restrictions).

To problem is: when i compile the Blink example and flash the blink.hex file, the LED lights up but doesnt go out. It stays lit...

Does Arduino code (hex file) require a bootloader or something that im missing?
4  Forum 2005-2010 (read only) / Troubleshooting / Re: arduino pro : usb + external power supply on: October 15, 2008, 02:53:56 pm
Wierd i have EXT or USB... Anyway EXT is external (so battery or adaptor)... When i use my arduino on a finisched product i use a 9V battery with a 7805 voltage regulator (brings power down to 5v). Works fine smiley
5  Forum 2005-2010 (read only) / Troubleshooting / Re: Midi in on: October 15, 2008, 02:49:10 pm
Ok i tried it without the whole optocoupler thing (what the heck), and it works perfectly, even with the 220K in between... And i cant be the parts, i swapt them all for others...

I dont even get with the use the darn thing (ok to seperate circuits)... But why you dont need one with midi out then ??  :-/ Whats the worst that could happen when not including the opto?
6  Forum 2005-2010 (read only) / Troubleshooting / Midi in on: October 14, 2008, 12:41:02 pm
Ok, this is driving me nuts!

Im making a midi in for arduino. Im using the schematic below (Expect i use a 4N27).  I cant seem to get it work. The optocoupler works. When i hook a LED to it, and use 5v, i can switch it on/off. But when i hook it up to my midi cable (Korg), nothing happens. Like the voltage is to low to switch anything... Wierd thing is when i hook a LED on pin 4 & 5 of the midi cable the LED flickers, almost on the beat... So i have no idea where to look.

7  Forum 2005-2010 (read only) / Troubleshooting / Re: AVR chip by itself on: November 13, 2007, 05:16:42 am
This is exactly what i wanted to ask! smiley-grin Today i got my Arduino but i dont want to buy a new one for each project (duh). Im glad to see its posible!

The programming, can it be done with the Parallel Programmer on the site?
8  Forum 2005-2010 (read only) / Development / ISP pins, dedicated? on: October 24, 2010, 12:19:19 pm
Hi,

Im was wondering if the ISP pins (miso, mosi etc), need to dedicated for ISP programming? Or can the pins be shared with peripherals? For ex. be connected to some LED's or select pins of a multiplexer. Because i really need all the pins i can get... And im using a 644 already smiley-razz
9  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: February 20, 2009, 10:24:36 am
Thanks Carkat, thats the first MidiIn schematic that worked for me! Using a 4N27. smiley
10  Forum 2005-2010 (read only) / Interfacing / Re: Multiplexing leds, faint leds on: September 27, 2010, 06:37:41 am
Damn, alot of replies... Like i said it works fine now with a analog multiplexer. And ofcourse im setting all the selectlines. (even when using only 3 bits).
11  Forum 2005-2010 (read only) / Interfacing / Re: Multiplexing leds, faint leds on: September 25, 2010, 11:11:53 am
Nice, works perfectly!  smiley-grin smiley-grin
12  Forum 2005-2010 (read only) / Interfacing / Re: Multiplexing leds, faint leds on: September 25, 2010, 09:34:10 am
Ok thanks all! Ill try some stuff on my breadboard smiley
13  Forum 2005-2010 (read only) / Interfacing / Re: Multiplexing leds, faint leds on: September 25, 2010, 09:21:23 am
Ok digital multiplexer makes more sence indeed, its just that i have the analog laying around smiley

So would need to make a pulldown construction like this? The switch would be the multiplexer then?
14  Forum 2005-2010 (read only) / Interfacing / Re: Multiplexing leds, faint leds on: September 25, 2010, 09:12:09 am
Hm, well maybe speed isnt the real issue, but its just that i have to wire up all the 80 leds seperatly... If i multiplex them per 5 (per step on the sequencer), i have 5 wires and then i can connect them all to them on the frontpannel.

15  Forum 2005-2010 (read only) / Interfacing / Re: Multiplexing leds, faint leds on: September 25, 2010, 08:12:49 am
Ok... Any suggestion how i multiplexer 16x5 leds? And i dont want so daisychain shiftregisters, thats way to slow (updating 80 leds every time).
Pages: [1] 2