Skip to content

6. Embedded Programming

Hero ShotšŸ’”

My assignments for this week were :

Group assignment:

  • Browse through the datasheet for your microcontroller
  • Compare the performance and development workflows for other architectures
  • Document your work to the group work page and reflect on your individual page what you learned

Individual assignment:

  • Write a program for a microcontroller development board to interact (with local input &/or output devices) and communicate (with remote wired or wireless devices)

Group AssignmentšŸ’”

Please follow this link for the group assignement documentation.

Individual AssignmentšŸ’”

Code

int buzzer = 28;
int Tilt = 27;
int Time = 100;
void setup() {
  pinMode(buzzer, OUTPUT);
  pinMode(Tilt, INPUT);
  pinMode(26, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  Serial.println(digitalRead(Tilt));
  if (digitalRead(Tilt) == 1) {
    digitalWrite(buzzer, HIGH);
    digitalWrite(26, HIGH);
    delay(Time);
    digitalWrite(26, LOW);
    delay(Time);
    digitalWrite(26, HIGH);
    delay(Time);
    digitalWrite(26, LOW);
    delay(Time);
    digitalWrite(26, HIGH);
    digitalWrite(buzzer, LOW);
  } else {
    digitalWrite(buzzer, LOW);
    digitalWrite(26, LOW);
  };
}

Video


Last update: May 7, 2024