# CS Discoveries 2020-2021

## Unit 6 - Physical Computing

### Lesson 2: Designing Screens with Code

• ``` setProperty(id, property, value) ```

### Lesson 3: The Circuit Playground

• ``` led.on() ```
• ``` led.off() ```
• ``` led.blink(interval); ```
• ``` led.pulse(interval); ```
• ``` led.toggle() ```

### Lesson 5: Board Events

• ``` onBoardEvent(component, event, function(event) {...}); ```
• ``` toggleSwitch ```
• ``` toggleSwitch.isOpen ```
• ``` button(L/R) ```
• ``` buttonL.isPressed ```

### Lesson 6: Getting Properties

• ``` getProperty(id, property) ```

• ``` soundSensor ```
• ``` soundSensor.value ```
• ``` soundSensor.setScale(min, max) ```
• ``` lightSensor ```
• ``` tempSensor ```

### Lesson 10: Arrays and Color LEDs

• ``` colorLeds ```
• ``` colorLeds[index].on() ```
• ``` colorLeds[index].blink(interval) ```
• ``` colorLeds[index].intensity(brightness) ```
• ``` colorLeds[index].color(color) ```
• ``` list[index]; ```

### Lesson 11: Making Music

• ``` buzzer.note(note, duration) ```
• ``` buzzer.playNotes(array, tempo) ```
• ``` list.length ```
• ``` var list = ["a","b","d"]; ```

### Lesson 12: Arrays and For Loops

• ``` for(var i=0; i<4; i++){ //code } ```
• ``` function myFunction(n){ //code } ```
• ``` Call a function with parameters ```

### Lesson 13: Accelerometer

• ``` accelerometer.getOrientation() ```

### Lesson 14: Functions with Parameters

• ``` function myFunction(n){ //code } ```
• ``` Call a function with parameters ```

### Lesson 15: Circuits and Physical Prototypes

• ``` pinMode(pin, mode); ```
• ``` digitalWrite() ```
• ``` var myLed = createLed(pin); ```
• ``` var myButton = createButton(pin); ```