From 54a777a340a4efde1809898ec94425513ee90f23 Mon Sep 17 00:00:00 2001 From: Tom Ball Date: Tue, 26 Sep 2023 09:44:46 -0700 Subject: [PATCH] add wall sensor --- assets.ts | 20 +++++++++++++++++++- tiles.ts | 12 ++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/assets.ts b/assets.ts index e6b0179a..717af4e5 100644 --- a/assets.ts +++ b/assets.ts @@ -25,6 +25,7 @@ namespace microcode { reg[TID_ACTUATOR_CAR_TURN_LEFT] = icondb.car_left_turn reg[TID_ACTUATOR_CAR_TURN_RIGHT] = icondb.car_right_turn reg[TID_ACTUATOR_CAR_STOP] = icondb.car_stop + reg[TID_SENSOR_CAR_WALL] = icondb.car_wall } // TODO: factor out all the jacdac stuff into separate file/class @@ -3030,7 +3031,24 @@ export const car_stop = img` . . . . . . . . . . . . . . . . ` - +export const car_wall = img` + . . . . . . . . . . . . . . . . + b b b b b b b b b b b b b b b b + 2 2 2 2 b 2 2 2 2 b 2 2 2 2 b 2 + 2 2 2 2 b 2 2 2 2 b 2 2 2 2 b 2 + b b b b b b b b b b b b b b b b + 2 2 b 2 2 2 2 b 2 2 2 2 b 2 2 2 + 2 2 b 2 2 2 2 b 2 2 2 2 b 2 2 2 + b b b b b b b b b b b b b b b b + 2 2 2 2 b 2 2 2 2 b 2 2 2 2 b 2 + 2 2 2 2 b 2 2 2 2 b 2 2 2 2 b 2 + b b b b b b b b b b b b b b b b + 2 2 b 2 2 2 2 b 2 2 2 2 b 2 2 2 + 2 2 b 2 2 2 2 b 2 2 2 2 b 2 2 2 + b b b b b b b b b b b b b b b b + . . . . . . . . . . . . . . . . + . . . . . . . . . . . . . . . . +` /* maybe use these later export const rc_high = img` diff --git a/tiles.ts b/tiles.ts index 8c7c203d..678c72de 100644 --- a/tiles.ts +++ b/tiles.ts @@ -30,6 +30,7 @@ namespace microcode { export const TID_SENSOR_MAGNET = "S10" export const TID_SENSOR_SLIDER = "S11" export const TID_SENSOR_ROTARY = "S12" + export const TID_SENSOR_CAR_WALL = "S13" // filters for TID_SENSOR_PRESS export const TID_FILTER_PIN_0 = "F0" @@ -261,6 +262,17 @@ namespace microcode { ] slider.constraints.handling = { terminal: true } + const wall = makeSensor(TID_SENSOR_CAR_WALL, "value_in", 500) + wall.constraints.allow.categories = [] + wall.constraints.allow.tiles = [ + TID_FILTER_COIN_1, + TID_FILTER_COIN_2, + TID_FILTER_COIN_3, + TID_FILTER_COIN_4, + TID_FILTER_COIN_5, + ] + wall.constraints.handling = { terminal: true } + const magnet = makeSensor(TID_SENSOR_MAGNET, "value_in", 500) magnet.serviceClassName = "magneticFieldLevel" magnet.jdExternalClass = 0x12fe180f