Arduino Tutorial 28: Using a Pushbutton as a Toggle Switch

In lesson 27 we learned how to incorporate a pushbutton into an arduino project. We learned how to utilize pull-up and pull-down resistors in order to incorporate a button into a circuit. The operation of the button in lesson 27 was pretty simple . . . if the button was held down, the LED would come on. When the button was released, the LED would turn back off. This is an interesting demonstration, but much more interesting is the case where we make a toggle switch. If you press and release the button, the LED comes on, and then if you press and release the button again, the LED goes off. While this sounds very similar to the previous case, it turns out to require a lot more thought. This video lesson explains how to think about this problem, and how to make it work.

If you want to follow along at home, you can order the Arduino Kit we are using HERE.

Below is the code we used to achieve the toggle operation. The video gives details on how to connect up the circuit.


9-Axis IMU LESSON 5: Calibrating the BNO055 9-axis Inertial Measurement Sensor

Our 9-axis BNO055 9-axis sensor connected to our Aurduino Nano

In this lesson we show you how to get a clean calibration on your BNO055 9-axis sensorIn the video below we take you through the coded needed to calibrate the sensor, and a simple technique to quickly get the system properly calibrated.

The code developed in this video will be used in future lessons, and is included below:

The code below is for demo purposes only, and should not be used in any real applications. It just demonstrates how to work with this sensor in benchtop presentations.


Arduino Tutorial 27: Understanding Pushbuttons and Pull Up and Pull Down Resistors

Being able to add push buttons to your projects adds important new capabilities to your prototypes. It is a clever way you can get input from a user. You could imagine using push buttons to turn something on or off, or they could be used to set motor speed or direction. In order to incorporate buttons into a project, you need to understand the concept of pull up and pull down resistors. In this tutorial we show you how to include buttons in a project, by demonstrating a simple on/off function on an LED.

If you want to follow along at home, you can order the Arduino Kit we are using HERE.

This is the code we used in this project to switch the LED on and off.


9-Axis IMU LESSON 4: Plotting Serial Data from Arduino with Control of Axis Scale

As this project continues it is very important for us to be able to quickly and easily plot data streaming from the sensor. The Arduino Serial Plotter has some real limitations, we recommend a simple “Serial Plotter” tool that can be downloaded. In this video we take you step by step through the download and installation process, and then an overview of how to use the tool.

Arduino Tutorial 26: More Fun with Photo Resistors

In this lesson we create an audible signal where the tone of the signal is proportional to the brightness of the light in the room. We use a photoresistor to measure the light in the room, and then use a passive buzzer to create the audible signal. The video shows you how to hook everything up, and the code we use is below. Your code might be a little different, as the math will depend on the light values where you are.

If you want to follow along at home, you can order the Arduino Kit we are using HERE. The nice digital voltmeter used in the lesson is available HERE.