Show Posts
Pages: 1 ... 6 7 [8] 9 10 ... 15
106  Using Arduino / Project Guidance / Re: 4 Digit Seven Segment Display Countdown Timer - Minutes to on: September 06, 2012, 12:18:16 pm
I would definitely avoid the Sparkfun module, it's a piece of filth.

Filmie, is this the sort of thing you're after? If so, you can have my code under the Beerware licence ;-) Although I think Crossroads is probably doing things in a similar way to me, regarding timekeeping variables etc.

107  Using Arduino / General Electronics / Re: PC ATX PSU transformer question on: September 06, 2012, 10:35:53 am


I would highly recommend Dave's tutorials on the subject! Good way to get started perhaps?
108  Using Arduino / General Electronics / Re: PC ATX PSU transformer question on: September 05, 2012, 01:41:41 pm
It'd be a good idea to research the difference between linear and switched-mode power supplies, and familiarise yourself with the basic "blocks" of each. Components from one cannot easily be repurposed for building the other.
109  Using Arduino / Microcontrollers / Just seen the H.A.D post for Teensy 3.0... on: September 05, 2012, 11:55:01 am
And I don't know about you guys, but it looks pretty awesome to me! Anyone else planning on getting one? I thought it'd make an ideal platform for sample-based synthesizer projects, and being able to use the Arduino IDE means less of a steep learning curve. I only wish they'd put M3 mounting holes on the bastards ;-) Any thoughts or opinions on the hardware / reasons not to bother with it?
110  Using Arduino / Project Guidance / Re: Light sensor with a beeper on: September 03, 2012, 01:19:09 pm
That's why I suggested using the peak detector. Here's a neat video which explains the concept:



I think it might be useful for this application smiley
111  Using Arduino / Microcontrollers / Re: ATtiny85 : Are these all different? on: September 02, 2012, 01:12:51 pm
Package just means the "shape" of the component, e.g. whether it's designed to be mounted through-hole (as you would on a breadboard for example) or surface-mounted.

Speed is exactly that - how fast the clock oscillator can run (which affects how quickly the '85 can execute instructions and perform other tasks).

For example, I have the ATtiny85-20PU. They are 8-pin DIP and will run up to 20MHz, although in my setup I usually have them running at 8Mhz as it's more than enough for my applications. If in doubt, those are probably the ones you want for prototyping with!
112  Using Arduino / Project Guidance / Re: Light sensor with a beeper on: September 02, 2012, 12:23:30 pm
Sounds like the sort of thing that could be done without an Arduino! Would probably be a lot easier without one as well. Essentially you're making a "clapper" circuit, but instead of going from sound to light, you're going the other way around.

Try using your LDR/voltage divider input with a comparator IC like the LM311. Experiment until you get the right reference voltage for it to respond to your flash. You may need a peak detector on the output to hold it for a little while... camera flashes are pretty quick!

Use the output from the comparator as the trigger for an oscillator circuit built around a 555 timer or whatever you have lying around that'll do the job. A square wave of a couple of khz will drive a little piezo buzzer quite happily.
113  Using Arduino / General Electronics / Re: Altera vs Xilinx. on: August 31, 2012, 12:15:21 pm
If you're just starting out, go for the cheaper option. It'll be quite some time until you out-grow it and by then you'll be able to justify the cost of the big daddy kits.

I know it's not quite the same thing (although I think the same rules apply!), when I wanted to get started with microcontrollers, I nearly went straight ahead and bought the STK500 and all the crap to go with it. But that was quite a lot of cash. So I thought "hang on... there's a good chance I might suck so bad at this I'll get bored and pissed off and never use it again"... so I got a £20 arduino board instead smiley-wink

You'll be learning the same principles on the cheaper kit anyway!
114  Using Arduino / Sensors / Re: LIS331 Acceleromerter on: August 30, 2012, 11:39:43 am
You might be able to knock something together yourself! The Arduino environment has an SPI and I2C library you can use to communicate with the device. Learn how to use this and you're set for life, and can work with pretty much any module communicating over those interfaces.

Read and re-read the datasheet for that module. That'll tell you everything you need to know about which registers to write to (to set up the device) and read from (to get your data). Using plenty of #defines to give the register numbers meaningful and memorable names might make things easier to write.

Even if things don't work first time you stand to learn a lot more than if someone had just given you the code.

By the way... I could be wrong here but there's no reason that example code shouldn't work with Arduino as it is. Providing you happened to have a board set up to run at 8MHz.
115  Using Arduino / General Electronics / Re: Using BCD 7 - segment decoder with PWM on: August 29, 2012, 10:30:13 am
So what's the idea? Hard-wire all the input pins on the decoder to make sure all outputs are high, then PWM the blanking input to make the outputs do the same thing?

Hmm.... it might work. Try it smiley Seems like the transistors will be manly enough to cope.
116  Using Arduino / Programming Questions / Re: detonator on: August 27, 2012, 12:18:18 pm
Oh piss it... hang on, I'll un-private it!  smiley-sweat
117  Using Arduino / Programming Questions / Re: detonator on: August 27, 2012, 10:48:58 am
Something like this you mean?



EDIT: I apologise for the video quality :p I have a much better phone these days.

I did a few "fake IED" prop things for airsoft and paintball games, but went over to 7-segment based displays as they're just easier and make for an ever-so-slightly more realistic counter-terrorist sim game. They're so cheap and simple you could stash loads of them all over the site and make it a real challenge to track down and defuse them all within the game time limit!

Have some code - I don't make them like this any more so feel free to do what you want with it (except make an ACTUAL bomb, of course). It's not the best bit of programming in the world but as you can see, it does work.

Code:

// Countdown Timer Version 1
// By BulletMagnet83
// For ATmega328 & Arduino

#include <LiquidCrystal.h>


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);


int seconds = 10;
int minutes = 0;

long previousMillis = 0;
long interval = 1000;

void setup () {
  
  pinMode(A0, INPUT); // seconds button
  digitalWrite(A0, HIGH); // turn on pullup resistor
  
  pinMode(A1, INPUT); // minutes button
  digitalWrite(A1, HIGH); // turn on pullup resistor
  
  pinMode(A2, INPUT); // start button
  digitalWrite(A2, HIGH); // turn on pullup resistor
  
  pinMode(A3, INPUT); // reset count button
  digitalWrite(A3, HIGH); // turn on pullup resistor
  
  lcd.begin(16, 2); // configure lcd for 16 columns 2 rows
  
}


void delaySet () {
  
  
  lcd.setCursor(0, 0);
  lcd.print("SET DELAY TIME");
  lcd.setCursor(0, 1);
  if(minutes < 10) {
    lcd.print("0");
    lcd.print(minutes);
  }
  else {
    lcd.print(minutes);
  }
  lcd.print(":");
  if(seconds < 10) {
    lcd.print("0");
    lcd.print(seconds);
  }
  else {
    lcd.print(seconds);
  }
  
  if(digitalRead(A0) == LOW) {
    seconds++;
    tone(7, 1400, 10);
    delay(200);
  }
  
  if(digitalRead(A1) == LOW) {
    minutes++;
    tone(7, 1400, 10);
    delay(200);
  }
  
  if(digitalRead(A2) == LOW) {
    countDown ();
  }
  
  if(digitalRead(A3) == LOW) {
    seconds = 10;
    minutes = 0;
    tone(7, 2800, 10);
    delay(100);
    tone(7, 2800, 10);
    
  }
  
  
  
  if(seconds > 59) {
    seconds = 0;
    minutes++;
  }
  
  if(minutes > 59) {
    minutes = 0;
  }

}



void countDown () {
  
  while(1) {
 
lcd.setCursor(0, 0);
  lcd.print("TIME REMAINING:");
  
   lcd.setCursor(0, 1);
  if(minutes < 10) {
    lcd.print("0");
    lcd.print(minutes);
  }
  else {
  lcd.print(minutes);
  }
  lcd.print(":");
  if(seconds < 10) {
    lcd.print("0");
    lcd.print(seconds);
  }
  else {
  lcd.print(seconds);
}
  
  static unsigned long lastTick = 0;
  
  if (millis() - lastTick >= 1000) {
  lastTick = millis();
  seconds--;
  if(minutes == 0 && seconds < 11) {
  tone(7, 2800, 50);
  }
  else {
    tone(7, 1400, 10);
  }
  }
  
  
  
  
  if(seconds < 0) {
    minutes--;
    seconds = 59;
  }
  if(minutes + seconds == 0) {
  
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("YOU'RE FUCKED");
    lcd.setCursor(0, 1);
    
    lcd.print("00:00");
    
    
    
    while(1) {
    }
  }
 
  }
}
  
  
void loop () {
  
  delaySet ();
 
}

118  Using Arduino / Project Guidance / Re: Running Arduino-compatible from batter(y|ies) without regulator on: August 27, 2012, 08:29:21 am
I use the LM2940 regulator on pretty much everything, but then all my stuff is 5V, 16MHz, so it makes sense for me to do that. If you had a 3.3V 8MHz  setup then a single lipo/no reg solution would probably be ok just like Crossroads said.

I like using them because it also gives me inbuilt reverse battery cockup and short-circuit protection, and given I have been known, on occasion, to do some monumentally stupid things it's nice to have a bit of a safety-net smiley-grin
119  Using Arduino / LEDs and Multiplexing / Re: Connecting a 7 segment display.... on: August 27, 2012, 07:52:24 am
Positive = Anode, Negative = Cathode.

And if it was me, I'd use the CAT4016 chip to drive common anode ones. If you want to drive them directly from the arduino there's no reason you can't (as long as you follow a few simple rules so you don't burn out your I/O pins). Try googling for "7 segment common anode arduino" and see what it throws up.
120  Using Arduino / Project Guidance / Re: Running Arduino-compatible from batter(y|ies) without regulator on: August 27, 2012, 07:37:21 am
Given their low cost I'd really REALLY consider using an LDO regulator when running from batteries. I wouldn't feel comfortable feeding any microcontroller-based project from an unregulated supply, even from batteries. It doesn't really add much complexity to the circuit smiley
Pages: 1 ... 6 7 [8] 9 10 ... 15