Project 1 Circuit (Blue Light)

Project 1 Explanation (Blue Light)

Block Circuits® uses electronic blocks that connect together to build different circuits. These blocks have different colors and numbers on them so you can easily identify them.

Build the circuit shown by placing all the parts. Install the code below to your Coding BlockTM and the blue LED (L2) lights.

Project 1 Code (Blue Light)

#define LED 9  // The pin the LED is connected to
void setup() {
  pinMode(LED, OUTPUT); // Declare the LED as an output
}
 
void loop() {
  digitalWrite(LED, HIGH); // Turn the LED on
}

Project 2 (Adding External Power)

Project 2 Explanation (Adding External Power)

Build the same circuit at project 1. After installing the program you do not need usb cable to powering your Coding BlockTM. Reconnect the usb cable and turn the switch on. Now use your 9V battery and connect it as shown on the circuit. Install a 9V battery into the 9V battery holder, plug it into the connector on the Coding BlockTM module (U1), and turn on the switch on the switch block (S1). Alternately you may power the circuit using the USB cable instead of the 9V battery.
Slide the switch header (S1), and the blue LED (L2) lights.

Project 2 Code (Adding External Power)

#define LED 9  // The pin the LED is connected to
void setup() {
  pinMode(LED, OUTPUT); // Declare the LED as an output
}
 
void loop() {
  digitalWrite(LED, HIGH); // Turn the LED on
}

Project 3 Circuit (Blinking Light)

Project 3 Explanation (Blinking Light)

This project explains the procedure for programming the Coding BlockTM module (U1). The microcontroller can be re-programmed in any circuit that uses it, by attaching the programming cable to it. When you initiate a new program download, any program currently running in the microcontroller is interrupted. When a new program download is complete, the new program will begin running.

The USB cable is needed to download new programs to the microcontroller, and to allow some programs to transfer information to/from the computer’s display. The USB also provides power to your circuits, so the 9V battery connector is ignored while you are connected to a USB device. Coding BlockTM has been programmed, you may disconnect the USB cable and run the circuit using the 9V battery connector.

Project 3 Code (Blinking Light)

void setup() {
  pinMode(2, OUTPUT); // We define the digital pin number 2 as an output to give electricity.
}
 
void loop() {
  digitalWrite(2, HIGH); // We provide electrical output from pin 2 with the HIGH command.
  delay(1000); // we are holding our code for 1000 milliseconds (1 second).
  digitalWrite(2, LOW); // We stop the electrical output with the LOW command from pin 2.
  delay(1000); // we are holding our code for 1000 milliseconds (1 second).
}

Project 4 Circuit (All Lights On)

Project 4 Explanation (All Lights On)

Build the circuit, install the program, turn on the switch (S1). The white and blue LEDs (L1 and L2) will lights.

Project 4 Code (All Lights On)

#define LED 9  // The pin the LED is connected to
void setup() {
  pinMode(LED, OUTPUT); // Declare the LED as an output
}
 
void loop() {
  digitalWrite(LED, HIGH); // Turn the LED on
}

Project 5 Circuit (Switching and Flashing Lights)

Project 5 Explanation (Switching and Flashing Lights)

Build this circuit. Load sketch Switching and flashing Lights into Coding BlockTM using the programming instruction. Arduino controls the two circuits LEDs (white and blue) and alternates turning them on and off by flashing.

This sketch uses the int command (int is short for integer) to assign a constant value that will be used within the sketch. Not necessary to be used. You can change the blink rate by editing the delay value, then reloading it into Coding BlockTM. The microcontroller on the Arduino Nano board lets you control the LEDs in ways that would be difficult to do using switches or other devices.

Project 5 Code (Switching and Flashing Lights)

void setup() {
  pinMode(2, OUTPUT); // We define the digital pin number 2 as an output to give electricity.
  pinMode(3, OUTPUT); // We define the digital pin number 3 as an output to give electricity.
}

void loop() {
  //white LED flashes 1st time
  digitalWrite(2, HIGH); // We provide electrical output from pin 2 with the HIGH command.
  delay(50); // we hold our code for 50 milliseconds.
  digitalWrite(2, LOW); // We stop the electrical output with the LOW command from pin 2.
  delay(50); // we hold our code for 50 milliseconds.

  //red LED flashes 2nd time
  digitalWrite(2, HIGH);
  delay(50);
  digitalWrite(2, LOW);
  delay(50);

  //blue LED flashes 1st time
  digitalWrite(3, HIGH);
  delay(50);
  digitalWrite(3, LOW);
  delay(50);

  //blue LED flashes 2nd time
  digitalWrite(3, HIGH);
  delay(50);
  digitalWrite(3, LOW);
  delay(50);
}

Project 6 Circuit (Flashing Lights and Buzzer)

Project 6 Explanation (Flashing Lights and Buzzer)

Build the project 5 and add buzzer module (BZ1) on the circuit as shown. Load sketch Flashing Lights and Buzzer into Coding BlockTM using the programming instruction. Arduino controls the three circuits LEDs (white and blue) and Buzzer. It alternates turning them on and off by flashing/beeping.

You can change the blink rate by editing the delay value, then reloading it into Coding BlockTM. The microcontroller on the Arduino Nano board lets you control the LEDs in ways that would be difficult to do using switches or other devices.

Project 6 Code (Flashing Lights and Buzzer)

void setup() {
  pinMode(2, OUTPUT); // We define the digital pin number 2 as an output to give electricity.
  pinMode(3, OUTPUT); // We define the digital pin number 3 as an output to give electricity.
  pinMode(7, OUTPUT); // We define the digital pin number 7 as an output to give electricity.
}

void loop() {
  //white LED flashes 1st time
  digitalWrite(2, HIGH); // We provide electrical output from pin 2 with the HIGH command.
  delay(50); // we hold our code for 50 milliseconds.
  digitalWrite(2, LOW); // We stop the electrical output with the LOW command from pin 2.
  delay(50); // we hold our code for 50 milliseconds.

  //red LED flashes 2nd time
  digitalWrite(2, HIGH);
  delay(50);
  digitalWrite(2, LOW);
  delay(50);

  //blue LED flashes 1st time
  digitalWrite(3, HIGH);
  delay(50);
  digitalWrite(3, LOW);
  delay(50);

  //blue LED flashes 2nd time
  digitalWrite(3, HIGH);
  delay(50);
  digitalWrite(3, LOW);
  delay(50);

  //Buzzer beeps 1 time
  digitalWrite(7, HIGH);
  delay(50);
  digitalWrite(7, LOW);
  delay(50);

  //Buzzer beeps 2 times
  digitalWrite(7, HIGH);
  delay(50);
  digitalWrite(7, LOW);
  delay(50);
}

Project 7 Circuit (Lighting Led with Button)

Project 7 Explanation (Lighting Led with Button)

Build this circuit. Load sketch Switching and flashing Lights into Coding BlockTM using the programming instruction. Turn on the switch (S1) and LED (L2) should be on. Now Turn off the switch (S1) and LED (L2) should be off.

You have to use the PC in this project as your power source.

Not important if a program is installed or not on the Arduino Nano board because non of signal pins of the board is used.

Project 7 Code (Lighting Led with Button)

No Code Needed 🙂