Show Posts
Pages: 1 ... 58 59 [60] 61 62 ... 69
886  Forum 2005-2010 (read only) / Exhibition / Re: NTSC video out library on: December 03, 2010, 04:14:41 pm
Sweet.  Of course right after I uploaded one of my own programs, my RS232-TTL converter blew (max232 workalike by ST) leaving my boarduino dead in the water.  It works just fine, I simply can't talk to it.  Happily, I was sitting on a "real" Arduino, not having even unboxed it yet.  This is my first actual Arduino...  So, I'm now a "Legit" Arduino user smiley

I'll skip getting another max232 for now and use the Arduino as an ISP programmer for the Boarduino I think.  I've been meaning to do this anyway, as I also got a "SmartLCD" device off ebay a while back, it's a ATMEGA168 with a dedicated 4x12 LCD and a couple of buttons.. think I got it for $3 shipped.. just haven't done anything with it as it needs an ISP programmer and I've been too lazy to load the sketch.

Now that I'm back and cooking with gas, made the minor changes (print_str removal, etc) necessary in my code-  and you are right- the line drawing is noticably faster.  VERY cool, I'll be updating my projects and posting some stuff with the new library probably by the end of the night..
887  Forum 2005-2010 (read only) / Exhibition / Re: NTSC video out library on: December 03, 2010, 11:50:04 am
Heh... small problem with your release: you forgot to include the fonts directory- the files (as used in DemoNTSC) of the fonts as well as fontAll.h must be in the main tvout library directory.  Without them the compile fails... they'll need to be included or the lib's not going to work

When I copied the files (.cpp & .h) from the source respository it compiled fine.  Looks like you just forgot to move them into the .zip of the lib... you'll probably have it done by the time you get the msg smiley-wink

Swapped the resistor over to pin 7, perfect.. looks awesome.  3d cube rotation.. cute!  Now to port over my own stuff and see what new things I ought not to do, but will do anyway..
888  Forum 2005-2010 (read only) / Exhibition / Re: NTSC video out library on: December 03, 2010, 11:01:13 am
 smiley-grin  

New toys, and it's not even Christmas yet!  Those linedrawing routines are about to get a test, should drastically speed up the update rate on the video spectrum analyzer jobbie.  There's a whole slew of projects I'm going to base off this, being chomping at the bit for the new release.  Please let me be the first to congratulate and commend you for bringing the new rev to fruition!

Bravo!  I really find the lib to be one of the most useful I've ever encountered-  great stuff.
889  Forum 2005-2010 (read only) / Exhibition / Re: NTSC video out library on: November 28, 2010, 08:37:55 pm
Well, I for one have to give a huge round of applause for the lib.  LED's are great, but that takes a ton of wiring.  LCD's aren't much better.  The ability to use a TV as an output device- something that all of us have already, no investment required- is just so dang useful for small-scale stuff that it's amazing.  It's an eye-grabber on a big-screen TV, and also PERFECT for using with portable LCD screens.. if you have kids, you probably have a portable DVD player.. and most have a video-in connection.  After the kids smear a peanut butter sandwich into the optics and mechanics of the DVD drive, the screen still works GREAT as a monitor, with it's own rechargable battery pack (which can also power the Arduino!).

Bravo!
890  Forum 2005-2010 (read only) / Exhibition / Re: NTSC video out library on: November 28, 2010, 05:52:38 pm
Igor, I'm a huge fan of the lib- and to answer your question, I believe there is an updated version of the bitmap function, however it is not in the version of the lib (5.91 with audio) that's there for download... I think the "current" beta revision for R6.0 (or whatever) can be compiled from the code repository.

It's got some really great improvements on an already AWESOME lib, I personally can't wait for the next Rev to hit the distro... the next rev also fixes some issues like incompatability with serial I/O which has been pesky for me and a couple of things I've wanted to do with the lib.  Since I post my projects, I'm (painfully) avoiding using any of the new code or features until the new rev is officially out there.  Coding from a modified lib... begs for problems.

New toys to play with coming... c'mon Santa, bring me a fresh lib to diddle with, and bring it early...

smiley-wink

 ALSO:

In another thread, I was discussing image processing from NTSC video input, and it ocurred to me that the reverse of this library ought to be possible- without even a sync separator chip, with two digital lines using set-point resistors (two step resistor ladder), you should be able to do monochrome video digitization-  average luma level below logic threshold yields zero, above yields one.  If using a high-contrast background to foreground, it's all just a matter of voltage level timing since the vsync pulse.  One digital input is set for the sync pulse level, and the other for the black to white threshold level.   Got any thoughts on this?
891  Forum 2005-2010 (read only) / Exhibition / Re: NTSC video out library on: September 17, 2010, 05:30:21 pm
Ok.

Well, given that, I might try to pull off the workaround.  Either way it should still work when the new library is released, it'll just be easier to do with the new lib smiley-wink

Great stuff!
892  Forum 2005-2010 (read only) / Exhibition / Re: NTSC video out library on: September 17, 2010, 04:38:38 pm
Thanks, I figured that was the case.  Had spent too much time banging my head trying to figure it out- I knew it had to be interrupt/lib related.

That being the case, what kind of time frame are you on for release of the lib with the updates?  Since my little "project" kind of requires the functionality of the yet unreleased code, I'll hold off on making it (publicly, anyway) until the code is out there as the current lib.  That way, people can duplicate what I'm doing.. if I document the project using the unreleased lib, then others will also need it, etc..

I may have a workaround- a mode switch.  If a particular pin is held high (connected to 5v) then instead of running the tvout/display routines, a serial-in-and-store-to-EEPROM code segment is run.  You then remove the 5v and reboot arduino.. which then reads from EEPROM and displays.  It could work....

does EEPROM lib use interrupts?

893  Forum 2005-2010 (read only) / Exhibition / Re: NTSC video out library on: September 17, 2010, 04:11:08 pm
Hmm.  I've now run into problems.  What I'm doing is trying to accept data via serial, store it in EEPROM, and display.  So far, lots of problems- and they seem to be library-related.

Code:
#include <TVout.h>

TVout TV;
char indata[256]="test";
int i,cnt,foo,t;

void setup()  {
//  TV.begin(_NTSC,128,96);
  Serial.begin(19200);
}

void loop()
{
  cnt=Serial.available();
  
  if (cnt>0) {
      delay(100);
      foo=Serial.available();
      for (t=0; t<=foo-1; t++) {
        indata[i]=Serial.read();
        i=i+1;
        };
  indata[i]=0;
  Serial.print(i);
  Serial.print(" bytes: ");
  Serial.println(indata);
  }
// TV.print_str(0,0,indata);
};

works fine with the TV references commented out, but as soon as you begin rendering, Serial data gets garbled and random chars get dropped.  I've cobbled it down to this to make troubleshooting simple.. in my mind, this code should be no problem- but it is.  pause_render() doesn't help.  I'm using R5.91 of the lib...

Thoughts?
894  Forum 2005-2010 (read only) / Exhibition / Re: NTSC video out library on: September 15, 2010, 08:23:27 am
Had another idea occur to me, but don't have the proper components at the moment- but I'm sure some of you do.

How about band-pass filters on the analog inputs (maybe with a smoothing capacitor) being fed audio... and then taking those analog values and mapping them to NTSC video vertical bars?  Instant audio spectrum analyzer!  Not sure if the analog reads and the interrupt-driven video generator would play that nice at the speeds it would make sense to sample at..  

So, unless I can find a whole bunch of RC values in the bottom of a box, I can't prototype this... but someone can, I'm sure!
895  Forum 2005-2010 (read only) / Exhibition / Re: NTSC video out library on: September 15, 2010, 12:20:58 am
Hehe.. just used your library and an broken portable DVD (broken transport) player to leave a video "love note" for my wife as she leaves for a business trip in the morning.

Coupled with one of these displays (mine has a 7.5v 3500mAH rechargable battery too!) your little library is providing the interface for a number of projects I'm working on.

In addition to the DVD player (which works PERFECT), I also have a orphaned 5.4" color LCD screen which also accepts NTSC, it's a "mobile monitor" for a Nintendo Gamecube.

Both also provide an amplifier and speakers for audio, if I had wanted to, adding a tune to the "card" would not be hard at all.  I'm sure you all have something similar around, there's something very cool retro about ASCII art... hehe.

Bravo on the engineering!  Keep it up!

Last but not least, and I'm sure it's been asked but not fully read by me- have you considered driving RGB on three different pins?  I'm thinking VGA, or really crude color for component monitors.. just a thought...
896  Forum 2005-2010 (read only) / Exhibition / Re: Arduino ECG/EKG Heart Rate Monitor on: December 23, 2010, 01:21:40 pm
Please do be careful.. one of the many jobs I had over the years was as a "Holter EKG Analyst".  A Holter monitor is a 24-hour ECG, at the time they were recorded to audio cassette tape, these days solid state memory is used.  The job consisted of doing the sampling from the tape, and then software would pre-process about 90% of the data, processing "normal" beats/rhythm out by binning.  That left the remainder to be manually reviewed, whether you were looking at ectopic beats/conduction defects, or simply confirming that the data was bad due to muscular or contact noise.  The Holter recorders themselves were battery powered (for portability mainly), but still used optical isolation for safety reasons.  Particularly if you are attempting telemetry with people who potentially already have conduction/ectopy defects, applying ANY current to the body is just plain dangerous.  Of all the parts of your project, making sure the thing is ironclad safe is the most important thing to spend research time on..

Suffice to say what you are trying to do is very feasible, I did this work nearly fifteen years ago.  Even the computers processing the data off the tapes were 486DX's... I'm wondering if the little Arduino may just have the ability to screen (bin out) normal morphology, it's a matter of pattern recognition of a standard QRS complex, those are easy peaks to grab and don't vary a lot in timing unless you get some really funky Junctional ectopy or a full-on Bundle Branch Block.  Since that's a damn serious condition, just call 911 if you see it and don't worry about it project-wise.  It's important to track P and T outside of the QRS complex, as that's where you will see heart block (PQ interval elongation (I), dissociation (III), and Wenkiebach (II)).  ST interval gives you depolarization and refractory time, from which most ventricular conduction problems can be figured out.

At least that's what they taught us back in the day... immensely oversimplified.  The point is, the pattern recognition may not be out of the number crunching range of Arduino.. your EKG could autoscreen for many arrhythmias easily just by tracking QRS, morphology is a LOT harder but possibly do-able smiley-wink

One more thought- you may want to compensate for and detect external pacing.  The pacing spike is typically an overdrive of the base atrial pacemaker node rate- overpacing by a BPM or two keeps those nasty little atrial ectopics in refractory while the paced beat does the pump work.  The spike itself is what you might need to plan for.  If you're using a threshhold to detect QRS, then the pacing spike (being fast and high voltage, comparatively, to a natural atrial self-pacing P) can be misread as a QRS.  If this isn't ever seeing clinical or pacing use then you can probably disregard the issue.

Good luck and keep posting!
897  Forum 2005-2010 (read only) / Exhibition / Re: Zombie Snack - Arduino/LCD game on: December 27, 2010, 10:43:13 pm
[media]http://www.youtube.com/watch?v=Kx2Zu8jxR5U[/media]

[media]http://www.youtube.com/watch?v=uEHwwojM7YY[/media]

Zombie Snack 1.0

What's your high score?
898  Forum 2005-2010 (read only) / Exhibition / Zombie Snack - Arduino/LCD game on: December 27, 2010, 07:35:39 pm
Okay, so I picked up a 16x2 LCD.. and decided that a little game would be a good use for it.

Enter Zombie Snack... a simple game, inspired by some of the dice-roll combat games of years gone by.  Eat brains, impress the ladies.

Two buttons..
Button One (digital 2) is EAT, which sends you after your human prey.  
Button Two (digital 3) is RUN, which chooses to walk away.

You have fifty hit points to kill and eat as many humans as you can, but humans vary in strength and they fight back!  If you reach zero hit points before you walk away, you die.. and score zero brains, no matter how many you had eaten until that point.  The goal is simple.. eat as many brains as you can while still having enough health to walk away!

Choose when to EAT and when to RUN carefully!

Press RESET to play again.

Potential future enhancements: Multiplayer, High Score Retention, and Specials (powerups for both Zombies and Humans!)

Full Code:

Code:
//      ** Zombie Snack 1.0 **
//         by Paul Bishop
//           12/27/2010
// --------------------------------
// A Brain-Munching Game for
// Arduino.  Program assumes
// 16x2 LCD connected on digital
// lines 7-12, and button switches
// on digital 2 & 3, ideally with
// 10k pulldown resistors (below)
//
//             10k Ohm
// Pin >----+---/\/\/\-------GND
//          |
//       SWITCH
//          |
//          +-----/\/\/\-------5v
//             100 Ohm
//
// LCD pins may be changed, but switches
// drive interrupts and must be on pins 2 & 3.
//
// Button connected to Pin 2 :  "Eat"
// Button connected to Pin 3 :  "Run"

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);  // 4-bit mode for LCD
byte c1[8] = {
  14,14,4,14,17,4,10,27};    // bitmap for human
int human;
int brains=0;
int hp=50;
int i,j,k=0;
int z;
volatile byte eat_press=0;
volatile byte run_press=0;
int action;



void setup() {
  pinMode(3,INPUT);                 // Input is two buttons,
  pinMode(2,INPUT);                 // "Eat" and "Run"
  digitalWrite(3,HIGH);             // Enable pullup resistors
  digitalWrite(2,HIGH);             //
  attachInterrupt(0, eat, RISING);  // handling buttons via ISR
  attachInterrupt(1, run, RISING);  // simplifies timing

  randomSeed(analogRead(0));        // Seed random number gen

  lcd.begin(16, 2);                 // set up the LCD's number of columns and rows
  lcd.clear();                      // and set our preferences
  lcd.noAutoscroll();
  lcd.noCursor();
  lcd.createChar(0, c1);            // 5x8 character bitmap from c1
  lcd.setCursor(0, 0);              
  lcd.print("Zombie Snack 1.0");     // Splash screen.
  lcd.setCursor(0, 1);
  lcd.print(" Come-n-Get It!");  
  delay(3000);
}



void loop() {
  lcd.setCursor(0,0);
  lcd.print("Brains:");
  lcd.print(brains);
  lcd.print("  HP:");
  lcd.print(hp);
  lcd.print(" ");
  lcd.setCursor(0,1);
  lcd.print("                ");
  lcd.setCursor(0,1);
  lcd.print("Human! ");

  for (int k=0; k<6; k++) {
    lcd.setCursor(8,1);
    for (i=0; i<k; i++) {
      lcd.write(32);
    };
    lcd.write(0);
    delay(100);
    if (eat_press==1) {
      attack();
    };
    if (run_press==1) {
      game_over();
    };
  };

  for (int k=5; k>-1; k--) {
    lcd.setCursor(8,1);
    for (i=0; i<k; i++) {
      lcd.write(32);
    };
    lcd.write(0);
    lcd.write(32);
    delay(100);
    if (eat_press==1) {
      attack();
    };
    if (run_press==1) {
      game_over();
    };
  };
}

void eat()
{
  eat_press=1;
}

void run()
{
  run_press=1;
}

void attack()
{
  lcd.clear();
  lcd.print("Zombie Attack!!");
  randomSeed(analogRead(0));
  human=random(10)+1;
  lcd.setCursor(0,1);
  lcd.print("Human- ");
  lcd.print(human);
  lcd.print(" hp!");

  delay(3000);
  while (human>0) {
    lcd.clear();
    lcd.print("Attack!!");
    lcd.setCursor(0,1);
    lcd.print("HP:");
    lcd.print(hp);
    lcd.print(" ");
    for (k=0; k<(10-human);k++) {
      lcd.print(" ");
    };
    for (k=0; k<human; k++) {
      lcd.write(0);
    };
    action=random(2)+1;
    if (action==1) {       // Yeah! You Hit the Human!
      lcd.setCursor(0,0);
      lcd.print("CHOMP!  Human -1");
      human=human-1;
      if (human==0) {
        delay(500);
        lcd.clear();
        lcd.setCursor(0,0);
        lcd.print("  Human Dead!");
        lcd.setCursor(0,1);
        lcd.print(">>> BRAINS! <<<");
        brains=brains+1;
        delay(2000);
      };
    };
    if (action==2) {          // Ouch!  You got hit!
      lcd.setCursor(0,0);
      lcd.print("OUCH! Your HP -1");
      hp=hp-1;
      if (hp==0) {
        game_over();
      };
    };
    delay(1000);
  };
  eat_press=0;
  lcd.setCursor(0,0);
  lcd.print("Brains:");
  lcd.print(brains);
  lcd.print("  HP:");
  lcd.print(hp);
  lcd.print(" ");
  lcd.setCursor(0,1);
  lcd.print("                ");
  lcd.setCursor(0,1);
  lcd.print("Human! ");
}

void game_over()
{
  run_press=0;
  lcd.clear();
  if (hp==0) {
    brains=0;
    lcd.setCursor(0,0);
    lcd.print(">> You Died! <<");
    lcd.setCursor(0,1);
    lcd.print("Brains: 0");
  }
  else
  {
    lcd.setCursor(0,0);
    lcd.print("Good Ghoul!");
    lcd.setCursor(0,1);
    lcd.print("Brains Eaten: ");
    lcd.print(brains);
  };

  while (1) {
  };  //loop forever
}


 
899  Forum 2005-2010 (read only) / Exhibition / Re: The 2ct DAC on: December 22, 2010, 06:15:59 pm
Dear lord, that's nothing short of brilliant.

I've also considered using PWM to drive a capacitor to supply external aRef voltage or to control the gain of an external amplifier.  I've also been sniffing around at the comparator built into the 328.  Thought projects at the moment only, but workable, I think.

This however is so damn elegant and simple.. bravo.
900  Forum 2005-2010 (read only) / Exhibition / Re: SSTV/POV project- Step 1 on: December 23, 2010, 02:16:10 pm
Yeah, I'm hoping I can use a lens or two and spin a few mirrors and get away with that, basically doing a poor-man's raster scan.  The arduino could easily handle the timing, the phosphor retention once dry is quite long, if you wanted to, you could take the better part of a minute to draw a video frame and the phosphor would still be working for you if you hit it at close range with UV.  When I said "SSTV", I meant SLOW scan.  I know there's got to be a few HAM guys here, and probably a few have SSTV stuff on a shelf.

People I think likely have SSTV equipment on a shelf:  Cr0sh, Grumpy Mike, Westfw.. a few others.  

I may even build the world's ghetto-est Oscilloscope.  In fact, I think that's kinda a stepping stone, anyway... that's just a single scan line.  Using a couple of motors, I may just be able to drag the LED around on the glass for a totally hackjob solution.
Pages: 1 ... 58 59 [60] 61 62 ... 69