Lab Report 2 by Diana Xu

Find limitations when simulating a program & Program the brain

I tried both MakeCode editor and Python editor. MakeCode editor is easy to use and it has a lot of different functions.  I tried input, LED and music functions

Use the sensors

First, I used the accelerometer as input and sound and lights as output. Microbit doesn’t have its own speaker, so I had to connect it to a headphone. The shaking function was really stable, and the audio volume was really loud. 

Then I tried the temperature sensor and the lightness sensor. They both worked quite well. Compared to Arduino, they are much easier to use.

Temperature sensor:

Lightness sensor

A basic animal behavior system

Konrad and I used the radio function to mimic a swarm of fireflies signaling to each other.

First Version: When the button on one Microbit is pressed, another one receives the signal and blinks the LED to give feedback. 

Second Version: We updated the code. When one Microbit sends the signal, both Microbit will blink the LED. And then we increased the number to three Microbits.

code reference:

https://microbit-micropython.readthedocs.io/en/latest/tutorials/radio.html

Lab Report 1 by Diana Xu

Research:

I did research on how different cellular automata vary from each other. I found all of the rules for one-dimensional cellular automata. Of the 2^8=256  elementary cellular automata, there are 88 fundamentally inequivalent rules (Wolfram 2002, p. 57).

Then I read chapter 7 in Dan Shiffman’s “The Nature of Code”, which explains the algorithms of cellular automata, Wolfram classification, the game of life and variations of cellular automata. Besides the explanations of the algorithms, Dan Shiffman mentioned that there are a lot of possibilities for people to explore the variations of cellular automata. He summarized them in seven categories in below( unfortunately I only found a code example for the first category) :

Non-rectangular Grids:

Example: The shape is a hexagon cell.

Hexagons

Probabilistic:

Example: In the Game of Life, the chance to die with four or more neighbors is 80%.

Continuous:

Example: Now, the state of cells is only 0 or 1. What if it’s a floating point?

Image Processing:

Example: Pixel is a cell and color is a state

Historical:

Example: “Visualize the Game of Life by coloring each cell according to how long it’s been alive or dead”

Moving cells:

Example: “Use CA rules in a flocking system. What if each boid had a state (that perhaps informs its steering behaviors) and its neighborhood changed from frame to frame as it moved closer to or further from other boids?”

 Nesting:

Example: Each CA cell is another smaller CA system.

Based on the algorithm of CA and Game of Life, Dan Shiffman created a 2D water effect: 

Screenshot of running the code
Effect implemented with shading and refraction

Find code examples:

Hexagon Cells

Game of Life OOP

2D Water

Tinker one implementation:

Original effect: 

Tinkered effect: 

Reflect:

Cellular automata are widely used in computer science, mathematics, physics, and biology. After my research, I found the cellular automata model can also be used in the field of arts, especially generative arts and nature of code.

The 2D water example combines physics and CA algorithm. It also uses pixel manipulation. And this algorithm can also combine with image processing since the concept of state and cell is widely used in pixel manipulation.

Reference: 

“Elementary Cellular Automaton.” From Wolfram MathWorld, mathworld.wolfram.com/ElementaryCellularAutomaton.html.

Shiffman, Daniel. “THE NATURE OF CODE.” The Nature of Code, natureofcode.com/book/chapter-7-cellular-automata/.

2D water tutorial by Dan Shiffman