after a snafu with my circuitry where the serial input wasn't working right, i finally have a completed board that does everything i want it to. yay.
Code on PIC microcontroller
include "modedefs.bas"
define osc 4
DEFINE DEBUG_REG PORTC
' Set Debug pin BIT
DEFINE DEBUG_BIT 6
' Set Debug baud rate
DEFINE DEBUG_BAUD 9600
' Set Debug mode: 0 = true, 1 = inverted
DEFINE DEBUG_MODE 1
DEFINE ADC_BITS 8 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (rc = 3)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in microseconds
inData VAR BYTE
forceVar VAR BYTE 'variable for force sensor
xVar VAR BYTE 'variable for accelerometer sensor - direction x
yVar VAR BYTE 'variable for accelerometer sensor - direction y
pulseWidthVar VAR BYTE
startdata VAR BYTE
touchVar Var byte
lijiangVar var byte
daliVar var byte
xiVar var byte
TRISA = %11111111
ADCON1 = 2
Pause 500
'mortar and pestle sensor inputs
input porta.0 'force sensor - pounding
input porta.1 'accelerometer sensor - direction x grinding
input porta.2 'accelerometer sensor - direction y grinding
'baskets selection sensor inputs
input portc.3 'Lijiang region
INput portd.0 'Dali region
input portd.1 'Xishuangbanna region
'led signals telling me what's going on
output portb.7 'main light signaling start of process...circuit is on
output portb.5
output portb.4 'light signaling Lijiang region touched
output portb.2 'light signaling Dali region touched
output portb.0 'light signaling Xishuangbanna region touched
'serial connection pins to processing contenct
input portc.7 'RX - receives bytes from processing
output portc.6 'TX - transmits byts to processing
'lights orange led to signal start
high PORTB.7
pause 250 ' pause 250 msec.
low PORTB.7
pause 250
'initializing variables
forceVar = 0
xVar = 0
yVar = 0
touchVar = 0
'starting touching process on the basket of material
startTouch:
lijiangVar = portc.3
daliVar = portd.0
xiVar = portd.1
if lijiangVar = 1 then
high PORTB.4
pause 250
low PORTB.4
pause 250
touchVar = 1
debug dec touchVar
goto main
else
if daliVar = 1 then
high PORTB.2
pause 250
low PORTB.2
pause 250
touchVar = 2
debug dec touchVar
goto main
else
if xiVar = 1 then
high PORTB.0
pause 250
low PORTB.0
pause 250
touchVar = 3
debug dec touchVar
goto main
else
high PORTB.7
pause 250
low PORTB.7
pause 250
debug dec touchVar
endif
endif
endif
goto startTouch
main:
ADCIN 0, forceVar
ADCIN 1, xVar
ADCIN 2, yVar
serin2 portc.7, 16468, [inData]
if inData = 65 then
serout2 portc.6, 16468, [forceVar]
serout2 portc.6, 16468, [xVar-125]
serout2 portc.6, 16468, [yVar-125]
endif
goto main
nodata:
pause 300
high portb.7
pause 300
low portb.7
goto main
in this week's crit, i presented the mini-model of roughly what the installation will look like as well as the next interation of what visuals the mortar and pestle input will generate (projected on the scroll) i need to really map out how the user will navigate through this narrative.
i am designing it to allow the following:
-user picks between 3 paths (representing the journey in each region).
-user pounds the mortar w/pestle to start the process and "release" an array of images.
-the images still have a linear direction since it shows my travel path....so even though it's a collection of photos for each region, it has a start and finish point where only one image is active at any moment.
-it is up to the user to apply the "grinding" effect of the mortar and pestle to direct the image to a corresponding location below the map of yunnan and the reward is a snippet of my thought applicable to that image or a factoid about the region.
before i begin building the actually installation which i envision to be approx. 4' x 4' made from mostly wood and foam, i wanted to make a smaller prototype so i can plan how to make it in the most efficient way possible. it has to be lightweight for easy setup and teardown. i want to avoid using any nails to imitate how the structures i am portraying used to be built. this is part of what i presented in class yesterday.
starting to build. central courtyard (sheyuan) model with 4-sided exposure. bass and balsa wood from Pearl Paint.
axon view. mortar and pestle representation at center (in yellow).
how user will enter. focus is along strong axis.
side.
full-scale scroll acting as "screen" to view images.
the space that i will be constructing will incorporate basic elements of chinese architecture. Yin Yu Tang is a really nice website that shows some excellent examples. even though it depicts a different province, alot of the concepts are comparable. for example, a central courtyard is the main activity center where work such as cooking, social functions and play take place.
the courtyard as the "focal" area of activity is where the mortar and pestle will be placed.
sample courtyard in Dali Province
the entrance will face south as this is considered to be the lucky orientation.
representations of the amazing way roof structures were constructed are also being made. called "tou gou", roofs were held up by an elaborate structure of stacked joints that involved no nails. the stacks fit snugly and were flexible (and survived) in heavy winds and earthquakes. (this model is seen in Lijiang province) they are also a status symbol. the more intricate the stack, the more important the household.