9. Embedded programming¶
This week I worked on coding my circuit board I had designed for electronics design week.
Group Work¶
Individual¶
So to reiterate from my week 7 electronics design here is my board:
If you want to see the process of creating it you can go here. To start the process of coding my board I started by utilizing a tinker cad to make a breadboard for my button and LED. The application was rather easy to use and it had all the essentials I would need for this project. I found this program in case I would be in a situation where I needed to make a breadboard but I didn’t have any on hand. With the breadboard made I just put in some simple dummy code to test out the led and see if it works. Luckily the simulation feature on the Tinkercad Arduino simulator worked perfectly there were almost no issues aside from human error.
From here I edited the code to work in a blinking fashion. It was rather simple. All I had to do was add a delay in between the led turning on and off. Here’s the code I used: the button and led pins are adjusted to fit my circuit board.
const int buttonPin = 10;
const int ledPin = 11;
int buttonState = 0;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
} else {
digitalWrite(ledPin, LOW);
}
}
After the tests were complete I opened the Arduino to upload my code to my board. While I was trying to fix my board from electronics design week for this project Brandon Whitter, a former Fab Academy student and one of my teachers, had found my Attiny board was a 1634 board which we weren’t supposed to have mixed into our collection of Attiny boards. It must have been purchased accidentally which is why I had so much issue trying to create my boards in the past. Afterward I fixed my board by replacing the microcontroller at Attiny 1616 and the upload worked perfectly.