Made by Tianyi He
A Simple Internet Appliance
Created: November 10th, 2023
I intend to start with argon and learn to build my first simple internet appliance using it.
E1
This was very straightforward and I got it first try except for forgetting the semicolon.
int led1 = D2; void setup() { pinMode(led1, OUTPUT); } void loop() { digitalWrite(led1, HIGH); delay(3000); digitalWrite(led1, LOW); delay(3000); }
E2
This was also straightforward and I did not encounter any problems.
int led1 = D2; void setup() { pinMode(led1, OUTPUT); } void loop() { for(int i = 0; i < 5; i++) { digitalWrite(led1, HIGH); delay(500); digitalWrite(led1, LOW); delay(500); } digitalWrite(led1, LOW); delay(3000); }
E3
For this question, at first, I did not hook the new LED to a new port, and then I realized the problem. After that, it became straightforward.
int led1 = D2; int led2 = D3; void setup() { pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); } void loop() { digitalWrite(led1, HIGH); digitalWrite(led2, LOW); delay(500); digitalWrite(led1, LOW); digitalWrite(led2, HIGH); delay(500); }
I learned that problems that seem simple might not be that straightforward when you first do it. Even simple problems require trial and error.
A hands-on introductory course exploring the Internet of Things and connected product experiences.