A simple buzzer. Pressed once it resets, keeping track of time. You could use it as a simple time reminder, for self-reflection when you started something or just to fool someone.
These are all the components you need for this project:
Before we start, just a quick explanation: When you open blokdots, two windows will appear. A smaller one, which we call “the Live View” (on the left) and a bigger one which we call “a Project” (on the right). Please keep that in mind when going through this tutorial.
Open blokdots and plug in your Arduino using the USB cable. On top of the Live View a little green box should appear, flashing your Arudino with the necessary firmata, so we can use it. If it does not work, simply unplug it and plug it in again, eventually it should flash.
Now plug in your components into the shield. In our example, we plug the Button into the slot “D2”. The LCD is a special component and therefore needs a special slot. For the LCD this slot is called “I2C”. Just plug it in any of those.
In the Live View you now can click on the slot you just plugged in a component and select it in the list. This way we tell the software which component to expect and how to handle it. If you have did this with the Button, try pressing it. In the Live View you should now be able to see a green bar and the number 1, when the Butotn is pressed. Now also connect the LCD. The slot for “I2C“ is at the very bottom of the list, so please scroll down. If it has been set up correctly, the LCD should light up and display “blokdots”. If not, again simply replug the Arduino to your computer.
We know it can be confusing to know which component needs to get into which slot. If you are not sure, click on “Connect A New Component” on top of the Live View, select the component you want to connect, and the “Wizard” will show you where to plug it in.
Now we need to switch windows. In the Live View we can control which components are actually connected, while in the Project we can add logic to them. Just select the Button and LCD here in the slot list and click “use” on both of them.
We are ready to go and let the programming begin! In the main area of the window (the white space) is a button. This one lets you add cards. We have two variants of cards, but for this project we will only need the “If … then …” version.
Once clicked on the button it changes to an empty card (blue). Step by step, you now can click through the different options and create your card. Try to build “If button is pressed 1 time, then counter should go up”. If a card is done, it will move away and make space for the button again. You can add as many cards as you like!
If you are happy with your project, do not forget to save. There is a little save button below the big “Run Project” button in the top left corner of the project window.
Now all that is left is to actually press the big “Run Project” button. If you want to change your code, simply press “Stop” again and make the changes you want.
The only thing that is left is to test your prototype of course!