Skip to content

Commit

Permalink
start on new icons/tiles (#510)
Browse files Browse the repository at this point in the history
* start on new icons/tiles

* more work on plumbing

* finish up front-end plumbing

* more fun with jacscript

* add distance

* add tooltips

* hide jacdac until connected

* refactoring for change var

* refactor function

* add function for reflected light (line following)

* line detection in place

* update distance calculation

* sensors working

* relay working

* fix for servo (angle)

* on/off logic

* remove enable on startup

* add servo power tile

* oops

* updated art

* fix regression with radio

* new samples

* more updates

* updated with new samples
  • Loading branch information
tballmsft authored Apr 3, 2024
1 parent 0c4378c commit 7b7c3c1
Show file tree
Hide file tree
Showing 58 changed files with 32,074 additions and 30,902 deletions.
126 changes: 118 additions & 8 deletions assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,19 @@ namespace microcode {
if (name == TID_MODIFIER_CAR_SPIN_LEFT) return icondb.car_left_spin
if (name == TID_MODIFIER_CAR_SPIN_RIGHT) return icondb.car_right_spin
if (name == TID_MODIFIER_CAR_LED_COLOR_1) return icondb.tile_color_red
if (name == TID_MODIFIER_CAR_LED_COLOR_2) return icondb.tile_color_green
if (
name == TID_MODIFIER_CAR_LED_COLOR_2 ||
name == TID_MODIFIER_ON ||
name == TID_FILTER_ON
)
return icondb.tile_color_green
if (name == TID_MODIFIER_CAR_LED_COLOR_3) return icondb.tile_color_blue
if (name == TID_MODIFIER_CAR_LED_COLOR_4) return icondb.tile_color_black
if (
name == TID_MODIFIER_CAR_LED_COLOR_4 ||
name == TID_MODIFIER_OFF ||
name == TID_FILTER_OFF
)
return icondb.tile_color_black
if (name == TID_MODIFIER_CAR_ARM_OPEN) return icondb.arm_open
if (name == TID_MODIFIER_CAR_ARM_CLOSE) return icondb.arm_close
if (name == TID_SENSOR_CAR_WALL) return icondb.car_wall
Expand Down Expand Up @@ -73,7 +83,12 @@ namespace microcode {
if (name == TID_MODIFIER_RGB_LED_COLOR_SPARKLE)
return icondb.tile_sparkle
if (name == TID_ACTUATOR_SERVO_SET_ANGLE) return icondb.servo_set_angle
if (name == TID_ACTUATOR_SERVO_POWER) return icondb.servo_power
if (name == TID_ACTUATOR_RELAY) return icondb.relay
if (name == TID_SENSOR_LIGHT) return icondb.light_sensor
if (name == TID_SENSOR_DISTANCE) return icondb.distance_sensor
if (name == TID_SENSOR_MOISTURE) return icondb.soil_moisture
if (name == TID_SENSOR_REFLECTED) return icondb.reflected_light_sensor
return null
}

Expand Down Expand Up @@ -1629,7 +1644,7 @@ namespace icondb {
. . . . . . . . . . . . . . . .
`

export const led_light_sensor = img`
export const led_light_sensor = img`
. . . . . . . . . . . . . . . .
. . 8 8 8 8 5 5 5 8 8 8 8 . . .
. . 8 8 8 5 4 4 4 5 8 8 8 . . .
Expand All @@ -1647,7 +1662,7 @@ export const led_light_sensor = img`
. . 8 f f f f f f f f f 8 . . .
. . . . . . . . . . . . . . . .
`

export const light_sensor = img`
. . . . . . . . . . . . . . . .
. . 8 8 8 8 5 5 5 8 8 8 8 . . .
Expand Down Expand Up @@ -2071,8 +2086,8 @@ export const led_light_sensor = img`
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
`
export const moveFaceUp = img`

export const moveFaceUp = img`
. . . . . . . . . . . . . . . .
. . . . . . . 8 . . . . . . . .
. . . . . . 8 8 8 . . . . . . .
Expand All @@ -2090,7 +2105,7 @@ f f f f f f f f f f f f f f f .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
`
export const moveFaceDown = img`
export const moveFaceDown = img`
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
Expand All @@ -2108,7 +2123,7 @@ export const moveFaceDown = img`
. . . . . . . . 8 . . . . . . .
. . . . . . . . . . . . . . . .
`

export const diceToss = img`
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
Expand Down Expand Up @@ -2856,6 +2871,25 @@ bffffffffffffffffffffffffffffffb
. . . . f .
. f f f . .
. . . . . .
`

export const servo_power = img`
. . . . . . . . . . . . . . . .
. . . 8 8 8 . . . . . 7 7 . . .
. . 8 8 8 8 8 . . . 7 7 7 7 . .
. . 8 8 8 8 8 . . . 7 7 7 7 . .
. . 8 8 8 8 8 . . . 7 7 7 7 . .
. . 8 8 8 8 8 . . . . . . . . .
. . 8 8 8 8 8 . . . f f f f . .
. . 8 b b b 8 . . . f f f f . .
. . 8 b c b b . . . f f f f . .
. . 8 b c c b . . . . f f . . .
. . 8 8 b b c b . . . . . . . .
. . 8 8 8 8 b c b . . . . . . .
. . 8 8 8 8 8 b c b . . . 5 5 5
. . 8 8 8 8 8 . b c b . . 5 5 5
. . . 8 8 8 . . . b . . . 5 5 4
. . . . . . . . . . . . . 4 4 .
`

export const servo_set_angle = img`
Expand Down Expand Up @@ -2986,6 +3020,25 @@ bffffffffffffffffffffffffffffffb
. . . . . 6 6 6 f 6 6 6 . 5 5 4
. . . . . . 6 6 6 6 6 . . 4 4 .
`
export const reflected_light_sensor = img`
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . f f f f f d d d d d . . . .
. . f f f f f d d d d d . . . .
. . f f f f f d d d d d . . . .
. . f 7 7 7 f d f f f d . . . .
. . f 7 7 7 f d f f f d . . . .
. . f 7 7 7 f d f f f d . . . .
. . f f f f f d d d d d . . . .
. . f f f f f d d d d d . . . .
. . f f f f f d d d d d . . . .
. . f f f f f d d d d d . . . .
. . f f f f f d d d d d . 5 5 5
. . f f f f f d d d d d . 5 5 5
. . . . . . . . . . . . . 5 5 4
. . . . . . . . . . . . . 4 4 .
`

export const kita_key_1 = img`
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
Expand Down Expand Up @@ -3397,6 +3450,63 @@ bffffffffffffffffffffffffffffffb
. . . . . . . . . . c f f f c .
`

export const distance_sensor = img`
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . 6 6 6 . . . . 6 6 6 . . .
. . 6 1 1 1 6 . . 6 1 1 1 6 . .
. 6 1 1 9 1 1 6 6 1 1 9 1 1 6 .
. 6 1 9 9 9 1 6 6 1 9 9 9 1 6 .
. 6 1 1 9 1 1 6 6 1 1 9 1 1 6 .
. . 6 1 1 1 6 . . 6 1 1 1 6 . .
. . . 6 6 6 . . . . 6 6 6 . . .
. . . . 2 . . . . . . 2 . . . .
. . . . 2 . . . . . 2 2 2 . . .
. . . . 2 . . . . 2 2 2 2 2 . .
. . 2 2 2 2 2 . . . . 2 . 5 5 5
. . . 2 2 2 . . . . . 2 . 5 5 5
. . . . 2 . . . . . . 2 . 5 5 4
. . . . . . . . . . . . . 4 4 .
`

export const soil_moisture = img`
. . . . . . . . . . . . . . . .
. . . . 8 . . . . . . . . . . .
. . . . 9 8 . . . . . 8 . . . .
. . . . 9 8 . . . . . 9 8 . . .
. . . 9 9 9 8 . . . . 9 8 . . .
. . . 9 9 9 8 . . . 9 9 9 8 . .
. . 9 9 9 9 9 8 . . 9 9 9 8 . .
. . 9 9 9 9 9 8 . 9 9 9 9 9 8 .
. . 9 1 9 9 9 8 . 9 9 9 9 9 8 .
. . 9 9 1 9 9 8 . 9 1 9 9 9 8 .
. . e 9 9 9 8 e e 9 9 1 9 9 8 .
. e e e e e e e e e 9 9 9 8 . .
. b e e e e e e e e e e e 5 5 5
. . b e e e e e e e e e b 5 5 5
. . . b b b b b b b b b . 5 5 4
. . . . . . . . . . . . . 4 4 .
`

export const relay = img`
. . . . . . . . . . . . . . . .
. . . . . f f f f f f . . . . .
. . . . f b b b b b b f . . . .
. . . f b b b b 9 8 b b f . . .
. . f b b b b 9 8 b b b b f . .
. . f b b b 9 8 b b b b b f . .
. . f b b 9 8 b b b 9 b b f . .
. 9 9 9 9 8 b b b b 8 9 9 9 9 .
. . f b b 9 b b b b 9 b b f . .
. . f b b b b b b b b b b f . .
. . f b b b b b b b b b b f . .
. . . f b b b b b b b b f . . .
. . . . f b b b b b b f . 5 5 5
. . . . . f f f f f f . . 5 5 5
. . . . . . . . . . . . . 5 5 4
. . . . . . . . . . . . . 4 4 .
`

/* maybe use these later
export const rc_high = img`
. . . . . . . . . . . . . . . .
Expand Down
Loading

0 comments on commit 7b7c3c1

Please sign in to comment.