Skip to content

Week04

In this week we started to learn about Micro-Controllers, which are basically like mini PCs or devices that can do automated tasks, without the need of user input.
They work and function in a similar way to our brain, we can attach sensors and other components to help the MC do more tasks.

Greeting Page

Blink Example
Uploading

issues

error1.jpg
error1sol1.jpg
error1sol2.jpg
error1sol3.jpg
error1sol4.jpg
error1sol5.jpg

Microcontrollers

Brief, learnings What is a micro-controller

Day 1 Sensors Types Fans . motor example cooling

Circuit Python

Day 2 Python

Code Sample

Code Explanation

Activities

Setting up CircuitPython (MicroPython)
1. Download this file.
2. Connect your device.
3. Put the file onto the flash drive.
4. Ta-DA.

Downloads

Easy Mode
Individual Assignment

Group Assignment

import time
import board
import digitalio

led = digitalio.DigitalInOut(board.D6)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(3)
    led.value = False
    time.sleep(1)

Troubleshooting

import time
import board
import digitalio
from random import randint

led = digitalio.DigitalInOut(board.D6)
led.direction = digitalio.Direction.OUTPUT

while True:
    t = randint(1, 10)
    led.value = True
    time.sleep(t)
    led.value = False
    time.sleep(t)

Setting up the chip

Setting up the Bootloader


Last update: May 27, 2023