SC-TILT SolderCore, SC-TILT Datasheet - Page 6

no-image

SC-TILT

Manufacturer Part Number
SC-TILT
Description
Daughter Cards & OEM Boards CoreTilt SExI Mod Accelerometer
Manufacturer
SolderCore
Datasheet

Specifications of SC-TILT

Rohs
yes
Product
Daughter Boards
Interface Type
I2C, SPI
Operating Supply Voltage
3.3 V
Further Information
Example programs written in C and CoreBASIC can be found at
www.SolderCore.com. Here is an example program for the CorePressure sensor in
CoreBASIC.
100 ' measure tilt along the x axis.
110 ' tube moves along the display according to the tilt of the
120 ' device.
130 '
140 ' It also shows how to use restricted bitmapped graphics
150 ' on a character LCD display by utilizing the CHARACTER-GRAPHICS
160 ' driver.
170 '
180 INSTALL "MODKIT-MOTOPROTO-SHIELD" AS MOTO
190 INSTALL "CHARACTER-GRAPHICS" USING MOTO
200 '
210 ' We want to use the accelerometer.
220 INSTALL "CORE-TILT" AS LEVEL
230 '
240 ' We set a low accelerometer bandwidth to smooth its
250 ' response and, hence, the response of the bubble.
260 LEVEL.BANDWIDTH = 50
270 '
280 ' Clear the background.
290 MOTO.LINE(0) = ""
300 MOTO.LINE(1) = ""
310 '
320 ' Run the level for a bit...
330 FOR I = 1 TO 8000
340 '
350 ' Compute the new bubble position.
360 ' converts the tilt linearly to a screen position.
370 ' The model is not really that brilliant, but
380 ' serves its purpose for this demonstration.
390 NEWX = 5 * INT(20 * LEVEL.X + 0.5) + 40
400 '
410 ' Remove the bubble from the old position and draw
420 ' it at the new position.
430 IF X <> NEWX THEN CALL SLIDE
440 '
450 ' Draw lines to delineate center.
460 ' wide, and I want a bubble 8 pixels across.
470 LINE 35, 0 TO 35, 15
480 LINE 45, 0 TO 45, 15
490 '
500 NEXT I
510 '
520 ' We're done.
530 END
540 '
550 ' Draw the bubble in the current color.
560 DEFPROC BUBBLE(X)
570 FILL X - 3, 5 TO X + 4, 11
580 ENDPROC
590 '
600 ' Move the bubble along the tube
610 DEFPROC SLIDE
620 COLOR 0 : CALL BUBBLE(X) : X = NEWX
630 COLOR 1 : CALL BUBBLE(X)
640 ENDPROC
10 ' Example program to demonstrate the CoreTile accelerometer
20 '
30 ' Written by Paul Curtis of Rowley Associates.
40 '
50 ' Do with this program what you like, just don't claim
60 ' that you write it.
70 '
90 ' We emulate a spirit level, using the accelerometer to
The virtual bubble in the
The display is 80 pixels
This crudely
6

Related parts for SC-TILT