Embedded Programming
Group Assignment
Note: I'm a complete beginner here, so I'll try to make this as simple as possible
What is a Toolchain?
- Toolchains are tools that help you write programs and translate them into a language that a device (Arduino, Raspberry Pi e.g.) can understand.
- The toolchain helps you load the program onto the device so it can run.
A toolchain includes:
- An editor - where you can write code
- A compiler - A translator which converts the code you write into code your device can understand
- An uploader - sends your code to the device
Arduino Development Workflow:
- Write code in Arduino IDE: Typically written in C++
- Compile Code: This is done by the IDE to create a format the device understands.
- Upload Code: Connect the device to your computer via USB and transfer the program.
- Run the program on the device: Arduino will be able to load and run the program on the device itself.
- Example: A simple program instructs the Arduino to pass current to a diode when a button is pressed.
Raspberry Pi Development Workflow:
- Write code: Various editors are available (Thonny, VS Code, Python).
- Run code: Raspberry Pi runs a full operating system (usually Linux). Therefore, you don't need to upload the code; you can just run it like a program on your computer.
- Capability: Unlike Arduino, Raspberry Pi can handle more complex tasks because of its operating system.
- Example: If you want to control a motor using the Pi, you write a Python script, run it directly on the Pi, and it controls the motor in real time.
Comparison between the two:
- Arduino: Simpler, perfect for smaller projects like controlling lights or sensors.
- Raspberry Pi: More powerful, like a computer. Ideal for complex tasks like running a web server or controlling multiple devices at once.
What are ARM and AVR?
- These are processors inside a device that adhere to the program you write to make the device do something.
AVR:
- Used in simpler devices like Arduino. They're great for simple tasks like reading a sensor or turning on a light.
ARM:
- These processors are used in more complex devices like smartphones and Raspberry Pi.
- They can run apps, connect to the internet, and control hardware all at once.
Simulated Environments:
Arduino:
Raspberry Pi:
- Raspberry Pi Desktop
- Pi VirtualBox Simulator
- Wokwi for Raspberry Pi Pico
Individual Assignment
For my individual assignment, I used Wokwi to create a simulated Arduino environment. The code I wrote turns on an LED when a button is pressed. This is a very simplistic program and design. I want to apply this tech to my Senior Thesis project. My project concerns sensing lung cancer via the signature of VOCs in one's breath. I will need to use an Arduino to actuate a solenoid valve. I think this will be a similarly simple set up, but the application has significant implications.