Loading...
  Show Posts
Pages: 1 ... 6 7 [8] 9 10 ... 14
106  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.
107  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
108  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 ();
 
}

109  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
110  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.
111  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
112  Using Arduino / Sensors / Re: Is there anything called vibration censor? on: August 26, 2012, 06:39:23 am
Another possibility would be to use a piezo element in some sort of padded pouch so it doesn't get punched to death  smiley-twist Have one in the target area, and sample the signal from it with an op-amp circuit and the ADC of an arduino or whatever mcu board you happen to be using.

Then, have something in your program that will map that data to one of several discrete options, from featherweight to Hulk Smash, and output THAT data over your serial port to the computer. That's how I'd approach the problem anyway, it may not necessarily be the best but it makes sense in my head.
113  Using Arduino / General Electronics / Re: How much WATTS do I need? on: August 26, 2012, 06:33:25 am
The LM386N is a good choice here. I messed about with them a bit, some years ago... easy to use, difficult to fry (as long as you don't deliberately abuse them). Google image search threw up about a million schematics to try, none of them are hard to build.
114  Using Arduino / Installation & Troubleshooting / Re: Output Voltages differ for different power supplies to the arduino. on: August 26, 2012, 06:24:42 am
If I remember right there's a bit of wiggle-room in what devices consider a logic high/low. I don't think it HAS to be bang-on 5.0V, just above a certain threshold. I power my stuff using LDO 5V regulators and usually, unless it wants a lot of current, a PP3 battery (because I have hundreds of the bloody things), and it always ends up pretty close to the 5V mark smiley
115  Using Arduino / Project Guidance / Re: Outputting a voltage on: August 23, 2012, 11:18:01 am
Yes, but not directly. You'll either need to use a PWM output and run that through a low-pass filter to get your voltage, or use something like a SPI/I2C interfaced DAC to do the job. Depending how much precision you want, I might be tempted to start with the first option as you only need a resistor and a capacitor smiley
116  Using Arduino / Project Guidance / Re: time counter on: August 19, 2012, 07:31:29 am
Even though the value stored in millis() rolls over after a certain length of time, you're only checking to see if it's increased by 1000... so it doesn't matter! It's not as if your code will drop dead as soon as it rolls over, it'll just start ticking over from 0 again and your other variables will stay how they were.

To print more than one number, just repeat that statement! The 7219 will latch it's digits so they won't change until you write something else to that location. I did have some example code somewhere, but I can't find it smiley-sad Sorry.
117  Using Arduino / General Electronics / Re: Is this the circuit I need, or something else? (Envelope generators) on: August 17, 2012, 04:15:31 pm
Ahh slight trail-of-thought fail in my original post smiley The outputs from that circuit are supposed to feed into the CV input of one of the various voltage-controlled amplifier circuits I have coaxed out of Google - I haven't decided which one to build yet but the simplest one seems like a good place to start!

Perhaps something like this: http://amplifiercircuit.net/voltage-controlled-amplifier.html might be a good starting point to experiment with?

The one thing I can't figure out just by looking at the envelope generator schematic is whether or not the attack level will ALWAYS eventually go up to the maximum, or does it's max level depend on the peak voltage of the trigger pulse? Might be one of those "build it and see" things... if the output level is proportional to the input (e.g. for a very basic sort of velocity sensing on a trigger pad), then I'm in business. If not, then I'm stuffed and need something else.



 

118  Using Arduino / General Electronics / Is this the circuit I need, or something else? (Envelope generators) on: August 17, 2012, 01:18:27 pm
Here's what I'm looking at right now:

http://casperelectronics.com/images/finishedpieces/benjolin/BenjAREnvGen2.jpg

What I want to achieve is individual Attack/Release controls for several channels of a drum synth (which, for many reasons including the fact I'm still a shitty coder, is leaning more towards being analog in nature), and also to provide a pitch EG where required. In my mind's eye I pictured having a board built up to host all the EG circuits, with the various gate outputs collected together on a header to go off to all the VCA/VCO control inputs.

This looks reasonably simple and buildable, and although I don't have any TLO74s I do have plenty of TLO81s which look like they might be a suitable substitute. Should I be looking at something else or is this circuit worth building and experimenting with?

119  Using Arduino / Programming Questions / Re: Parallax laser range finder need help on: August 13, 2012, 02:53:02 pm
Sorry for not actually posting a reply offering help, but would you mind telling me which LRF you have? I wouldn't mind getting one myself and having a play-around.
120  Using Arduino / Audio / Getting a wav file onto an EEPROM (or into flash memory) on: July 30, 2012, 12:53:29 pm
I've been doing a bit of research/work on the drum machine project idea I had a while back, and I'm trying to wrap my head around how best to process a wav file in order to dump it either into flash memory or, as is more likely, onto an old-style parallel E(E)PROM. I don't have a programmer yet for said ROMs but I can go shopping for one next payday - in the interim I want to test the files from the flash memory of one of the ATmega328's I have knocking around. A single sample is about 18.7kb, so one will fit smiley

The general idea for a rough-as-guts test bed is to simply shove all the data out in parallel on PORTD or something, through a DAC and see what I get (if anything) on the other end. I'd rather have some idea if it's going to work before going equipment shopping!

So far, I have:

Wave files processed in Audacity and exported as RAW(header-less), unsigned 8-bit, 32khz mono.
A HEX editor, specifically Frhed, which I have so far used for comparing the "normal" wav with the header-less one just for a look, and exporting the data as a hexdump text file.


What's the best way to get the compiler to take this data and shove it in flash memory as a great big array so I can read through it from my main program? I'm googling in another tab as I write this, but it's a bit hit-or-miss not knowing exactly the technical programming terms for some things.

Pages: 1 ... 6 7 [8] 9 10 ... 14