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
|
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; } }  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?
|
|
|
|
|
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!  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 
|
|
|
|
|