Skip to main content

Posts

Showing posts with the label math operations

Day 2: Math Operations, Overflow and Underflow, Printf and Scanf

Lab Today we started with our first Arduino lab. We first wanted to make one LED on a breadboard blink, then get 4 LEDs to blink. I was able to do this successfully using the code below. void setup() {   // put your setup code here, to run once: pinMode(11, OUTPUT); pinMode(10, OUTPUT); pinMode(9, OUTPUT); pinMode(3, OUTPUT); } void loop() {   // put your main code here, to run repeatedly:   digitalWrite(11, HIGH);      delay(500);   digitalWrite(11,LOW);   digitalWrite(10,HIGH);      delay(500);   digitalWrite(10,LOW);   digitalWrite(9,HIGH);      delay(500);   digitalWrite(9,LOW);      delay(100);   digitalWrite(11, HIGH);   digitalWrite(3,HIGH);   digitalWrite(10,HIGH);   digitalWrite(9,HIGH);   delay(100);   digitalWrite(11, LOW);   digitalWrite(3,LOW);   digitalWrite(10,LOW);   digitalWrite(9,LOW); ...