warning: Creating default object from empty value in /home/dr_rick/onearmedman.com/modules/taxonomy/taxonomy.pages.inc on line 33.

Major Studio: Interactive

The subject name for the Major Studio: Interface class.

Working Game Code

So, we have working game code for the trauma bear. See the attachments for that.

The first file the processing code and the second is the arduino code.

Photos and videos to come.

State Machine Complete (Maybe)

So, we've got that main processing code ready to go! Sort of. Inti has kicked ass getting the physical states codified, and the processing code looks great with the graphics that Tracy posted. I now need to combine the physical pieces that Jay has built for the intubation and ventilator and accelerometer (all of which are killer!) with the Arduino code with the finished state machine and get the thing running.

Very, very soon, this bear will live! And then die!

Processing code is attached below.

Algorithm For the Bear

Just a bit of pseudo-code that shows the state transitions in our trauma bear project.

		-> convulse_cardio
		-> convulse_flatline
		-> convulse_gi
	*time < 20 && comp >= 6 && accel. == BACK
		-> stable
		-> death
	*time > 10
		-> any_touch
	*time > 5
		-> shallow_vital
	*time > 10 && accel. < error_movement
		-> well
		-> need_more_comps
	*reset_button == HIGH
		-> start
	*reset_button == HIGH
		-> start
	*accel. == SIDE && time < 15
		-> ready_to_intubate
	*intubated == HIGH && time < 15
		-> tube_convulse 
		-> death
	*time < 20 && comp >= 6 && accel. == BACK
		-> stable
	*time < 20
		-> need_air
		-> death
	*intubated == HIGH && pumps >= 6 && time < 20
		-> stable
		-> death
	*flatline_total < 3 && paddles_applied && time < 20
		-> paddled
		-> death
	*intubated == LOW && time < 15
		-> shallow_vitals
		-> death
	*intubated == HIGH && time < 15
		-> intubated
		-> death
	*accel. < error_movement && time > 10
		-> well
		-> needs_air
		-> flatline
		-> well
	*time < 20 && accel. > error_movement
		-> flatline
	*time >= 20
		-> death

Progress With The Bear

Here's what's new with the bear project as of yesterday:

  • Roller switch installed in the chest. Giving it six hits restores normal heart rhythm in the bear.
  • New "convulse" routine. The bear convulses until CPR is performed.
  • Improved chest action. Two metal plates sandwich the servo, make a much more realistic breathing response. Extra stuffing and the rumbler for the heart sit on top.
  • Accelerometer wired up and coded to check for the proper positioning of the bear, i.e. the bear must be laying down before CPR can be performed effectively
  • Work has begun on the sounds, both the simple ones for the bear and the richer ones on the Processing interface.

Haptics Code

Here is the Arduino code (see attachment) for the three haptics projects we made this week. Not exactly pretty production code, but good enough to start hacking around with. The key pieces are the timings and intensities, so pay special attention to those.

You'll also need to uncomment the various function calls in the loop() to make different projects work. They should be self-explanatory, be give me a holler if you run into issues. You can leave comments on this post by logging in with your A server name and password.

Shoot From The Head!

The Shaky Cap: Like a shot to the cranium!The Shaky Cap: Like a shot to the cranium!By far our strangest interface, the haptic helmet creates the feeling of shooting out the top of your head, as if you yourself were the player's shapeship in Galaga.

One vibrating motor is positioned in a knit cap at the base of the skull. A second one is place farther up on the head. By tweaking the timings and intensity, based on our original shooter interface, the user gets the feeling of a pulse travelling up from the back of his or her head.

The Helmet of Doom: Rattles ya!The Helmet of Doom: Rattles ya!As icing on this strange little cake, we put our big, custom-made rumbler in this helmet, which fits over the top of the knit cap. The low-frequency shaking adds just the right kind of touch to the shooting effect--it really rattles you a little bit.

Personally, I don't fit into the helmet. My noggin is huge. But for someone with a skull a few sizes smaller than mine, I can see this being a lot of fun. It's definitely very trippy.

Haptic Bear

The haptic bear we built has a beating heart and breathing lungs. The heart is a vibrating disc motor that pulses in the familiar rhythm. The lungs are a servo with an arm that pushes on a metal plate in the chest cavity.

The video doesn't really do him justice, but he is incredibly cute, despite his recent surgery:

Haptic Paddle Testing

We extended our haptic paddle to use three motors. The code now times the pulses between the three and randomly picks one of five points to hit. If it hits on the extreme of one side, the first motor fires, then the middle, than the one on the opposite end. The intensity reduces, too. If it's only slightly to one side, the side and middle fire at once, with reduced intensity, and then the far side fires. If the middle is the target, it fires at full intensity, then the two ends fire.

Cursory user testing has revealed some interesting results:

Do Ya Feel It? That's Haptics, Kid!

Lots of good progress today on the haptics project. Cicek covers the "heartbeat" and "shotgun" assignments, complete with video.

The heartbeat is fairly straightforward. The Arduino kicks out two 50ms bursts of the vibrators motors separated by 10ms, followed by a 500ms pause. The second burst is at 75 percent of the duty cycle coming off the PWM. It's eerily effective.

The shooter took us a while to perfect, but I think we've got a good one. The best way to see what we've done with it is to check the source code (attached below,) but the gist of it is that we start off with a heavy vibration from both the mini-vibrating motor (in the grip) and our custom-built macro-vibrating motor. The latter is a generic DC motor with an offset weight hot-glued to the shaft contained inside the top of an old spray can and attached to the area where the "bolt" would be on a rifle. Then we added another pulse from another mini located downrange on the barrel. By tweaking the timings, you get a fairly good sense of the gun kicking when you hit the cute red trigger.

Bluetooth Research

Bluetooth: Ye olde King BluetoothBluetooth: Ye olde King BluetoothBluetooth is a wireless protocol for sending serial data over the air. It was named after Harald I of Denmark. In fact, the symbol for Bluetooth consists of the runes for that king's name.

In order to put a project together, you'll need the following resources:

  • A Bluetooth modem board, such as the BlueSMiRF
  • An Arduino board or stamp
  • Outputs from the Arduino (vibration "rumble" motors in our case)
  • Input to the Arduino board (like our accelerometers)
  • A computer or other device that can communicate via Bluetooth (most recent Macs and laptops, as well as certain Nokia phones, etc.)

Copyright Mike Edwards 2006-2009. All content available under the Creative Commons Attribution ShareAlike license, unless otherwise noted.

Syndicate content