TIce

From Texas Instruments Wiki
Jump to: navigation, search

TIce logo.jpg

Introduction / Inspiration

Do you know following situation? You are sitting around with your friends and you don’t know what to do.

Suddenly somebody has the idea of playing a classic board game (e.g. ludo (dt. Mensch Ärgere Dich Nicht)).

After looking for the game, you finally find it. But something very important is missing – the dice.

This is only one scenario, in which our universal dice tool called “TIce” for the eZ430-chronos can help you, as

its huge advantage is that this “dice” is very unlikely to be lost because it is fixed around your wrist ;-)


All in all, TIce is a universal dice tool which you can use in various situations.

Here are some examples:

  • referee: coin missing for choice of ends
  • teachers: support to create marks (which pupil will be questioned, create marks)
  • different dice and board games
  • Ludo (dt. Mensch Ärgere Dich nicht!)
  • Game of Life
  • Backgammon
  • Monopoly
  • Barricade (dt. Malefitz)
  • ...
  • rolegames (for pen & paper games): a lot of different dice are necessary
  • The Dark Eye
  • Dungeons & Dragons
  • ...
  • decision guidance: it supports you in diverse daily life situations (we assume no liability for wrong decisions!!!!)

Authors

  • Michael Sax
  • Peter Reiser

When you have any questions, please mail to us: (TIce.chronos@gmx.de)

Features

  • simple to supplement to each chronos without losing any factory firmware applications
  • installation requires less than 10 minutes (see Download/Setup/SourceCode)
  • toss up to 10 dice simultaneously
  • all common known of number of sides implemented (20 types) (compare list: http://en.wikipedia.org/wiki/Dice)
  • evaluation after rolling dice possible (sum, maximum, minimum, average)
  • code size limited (code size only about 12 kbytes)
  • easy to create your own number of sides

Usage Introduction

Picture Description Picture Description
TIce1.JPG Step 1

Push ‘*’ to cycle through modes on top LCD line until “DICE” is displayed.

TIce2.JPG Step 2

Push ‘up’ to start the program.

TIce3.JPG Step 3

Choose the number of dice with ‘up’ and ‘down’.

TIce4.JPG Step 4

Push ‘#’ to confirm the number of dice.

TIce5.JPG Step 5

Choose the number of sides with ‘up’ and ‘down’ and confirm it with ‘#’.

TIce6.JPG Step 6

Shake the watch to generate random numbers.

TIce7.JPG Step 7

Select the displayed dice with ‘up’ and ’down’.

TIce9.JPG Step 8

Push ‘#’ to continue.

TIce9.JPG Step 9

Choose the mode with ‘up’ and ‘down’ and confirm it with ‘#’.

  • ESC => leave program
  • retry => try again with the same settings
  • info => enter analysis menu
TIceA.JPG Analysis Menu

Choose the mode with ‘up’ and down’ and leave the menu with ‘#’.

  • totl => sum of random numbers
  • low => min number
  • high => max number
  • avrg => average number

Functional Description

TIceFlow.jpg

TIce generates random numbers using data from the 3-axis accelerometer. The program gets the values from the sensor in constant intervals and adds the measurements of all axes. The value is stored in an array for further use if it exceeds 350. Thus the watch will only create random numbers if shaked.

The process endures always until the array is filled completely to achieve an approximately equal period of "rolling the dice". After this, the program gets further data from the accelerometer and compares them in constant intervals to detect the shaking stop. Until this occurs, sole values from the axes will be added to the contents of the array elements.

When you stopped shaking, the data of one element is divided by the number of sides for each dice and the remainder is increased by one. As a result of these operations, random numbers are generated by TIce.

Following chart shows the relative frequency of dice numbers.

Test conditions: Generate 25 times random numbers with 10 dice (6 sides) on the one hand with our TIce tool and on the other hand with a traditional dice cup.

Relative frequency.jpg

Download/Setup/SourceCode

The simplest way to get TIce on your chronos is to flash the .txt file via the Chronos Control Center (no disassembly required)!!


The other way:

  • Download/Start CCS (limited edition is enough) [1]
  • Import Existing CCS sportswatch project
  • ATTENTION: Use latest firmware version (revision b) [2]
  • Select Active Build Configuration (433, 868 or 915 MHz, CCS limited edition)
  • Replace main.c, menu.c, and menu.h and insert dice.h and dice.c to the common logic folder
  • Change compiler settings (necessary to reduce memory on cc430)
  • Project properties -> C/C++ Build ->MSP430 Compiler -> Basic Options -> Set Debugging Model to “Symbolic debug for program analysis”
(After that no debugging is possible, change back to previous settings to debug)
  • Flash program to device
  • Stop Debug
  • Have fun with this application!


Required Source Code Files