Your LED cube ENGR 40M Chuan-Zheng Lee Stanford University 28 - - PowerPoint PPT Presentation

your led cube
SMART_READER_LITE
LIVE PREVIEW

Your LED cube ENGR 40M Chuan-Zheng Lee Stanford University 28 - - PowerPoint PPT Presentation

Your LED cube ENGR 40M Chuan-Zheng Lee Stanford University 28 July 2017 Electrically its an array, but physically How do we arrange these in a 4 4 4 cube? E July 28, 2017 ENGR 40M Summer 2017 C.Z. Lee, J. Plummer, R. Howe


slide-1
SLIDE 1

Your LED cube

ENGR 40M Chuan-Zheng Lee Stanford University 28 July 2017

slide-2
SLIDE 2

Electrically it’s an array, but physically…

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 2 E

How do we arrange these in a 4 × 4 × 4 cube?

slide-3
SLIDE 3

…it’s a cube?

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 3 E E

slide-4
SLIDE 4

…it’s a cube?

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 4

bottom second from bottom second from top top

E E

slide-5
SLIDE 5

Decomposition

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 5

loop() display() getLEDState() The main Arduino loop Does one pass through the LEDs (time-division multiplexing) Looks up the LED state associated with an anode/cathode pair

calls which calls

slide-6
SLIDE 6

Mapping between 2-D and 3-D

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 6

E E

y

slide-7
SLIDE 7

Mapping between 2-D and 3-D

We want a function that maps from anode/cathode pairs 𝑏, 𝑑 (e.g. “ ”) to 3D coordinates 𝑦, 𝑧, 𝑨

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 7

y

slide-8
SLIDE 8

Mapping between 2-D and 3-D

Anodes Cathodes

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 8

y y

slide-9
SLIDE 9

Mapping between 2-D and 3-D

y

Operations we might consider using:

  • * (multiplication)
  • % (modulo division)
  • / (integer division)
  • & (bitwise and)
  • | (bitwise or)
  • ^ (bitwise xor)

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 9

slide-10
SLIDE 10

What do bitwise operations do?

  • Bitwise operations apply to ea

each bit it in the binary representation of a number in indi divid idually Examples (in binary): 00110101 | 01100011 == 01110111 00110101 & 01100011 == 00100001 00110101 00110101 | 01100011 & 01100011 01110111 00100001

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 10

slide-11
SLIDE 11

Mapping between 2-D and 3-D

We want a function that maps from anode/cathode pairs 𝑏, 𝑑 (e.g. “ ”) to 3D coordinates 𝑦, 𝑧, 𝑨

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 11

y

slide-12
SLIDE 12

Mapping between 2-D and 3-D

Anodes Cathodes

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 12

y y

slide-13
SLIDE 13

Making the mapping function easier

y y

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 13

You can reorder the anodes/cathodes however you like. Would a different ordering make the relationship simpler?

slide-14
SLIDE 14

Mapping between 2-D and 3-D

y

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 14

slide-15
SLIDE 15

Mapping between 2-D and 3-D

July 28, 2017 ENGR 40M Summer 2017 — C.Z. Lee, J. Plummer, R. Howe 15

y