How to Read evive’s Potentiometers in PictoBlox

evive Poentiometers
About This Tutorial
This tutorial discusses what are potentiometers, evive’s potentiometers and how to read them in PictoBlox, and how to control the brightness of an LED using one of evive’s potentiometers.
Tutorial Info

Components Required

ImageComponentQuantityAvailable in Kit
evive1
USB A-B Cable1

Introduction

A potentiometer is nothing but a variable resistor, i.e. we can easily vary/change the value of the resistor by moving or turning the slider or the knob respectively. Since the movement of the slider or the knob is smooth and continuous, the change in the value of the resistance is smooth.

evive has two inbuilt 10kΩ knob potentiometers connected to Arduino Mega pins A9 and A10, respectively.

evive PoentiometersWith the help of the potentiometers, you can control the speed of a DC motor as well as the angle of a servo motor through evive’s firmware. You can also control the amplitude and frequency of a signal in a function generator.

How to read evive’s potentiometer in Scratch

You can read evive’s potentiometer in PictoBlox with the help of a block in the evive palette known as the potentiometer () reading block.

potentiometer reading

Activity: Controlling the Brightness of pin 13 LED

Scratch Mode

evive Notes Icon
When working with evive on PictoBlox for the very first time, or if you’ve previously uploaded another code to evive, you must upload the firmware in order to upload new code to it. You can find the procedure for the same HERE.

Follow the steps below to write the script:

  1. Connect evive to your computer and open PictoBlox; if already open and working on a project, save that project. Then, click on New.
  2. Go to the toolbar and click on the Board menu. Then select evive as your board. Pictoblox Board Selection
  3. Next, click on the Connect menu and from the fly-out menu, select the Port to which evive is connected e.g. COMXX or ttyXX.Once you select the port, the icon beside the Connect tab will become connected.Connect-Disconnect Icon
  4. Go to the Events palette and drag and drop the when flag clicked block.
  5. Next, go to the Control palette and drag and attach the forever block below the when flag clicked block.
  6. Then, go to the Variables palette and create a variable named Brightness and drag and drop the set () to () block inside the forever block; Brightness is set as default.
  7. Next, go to the evive palette and drag and drop the potentiometer () reading inside the space in the set () to () block; potentiometer 1 is set as default potentiometer.Controlling evive's Switches in PictoBlox_potentiometer_block
  8. Then, drag and drop the set pwm pin () output as () block below the set () to () block. Inside this block, drag and drop the ()/() (division operator) block from the Operators palette.
  9. Inside the first space of the ()/() block, drag and drop the Brightness variable block; in the second space, drag write 4.Controlling evive's Potentiometer_Stage

Below is the complete script:

Controlling evive's Potentiometer_Stage

Click on the green flag to run the script and rotate the potentiometer to change the brightness of the LED. 

Click on the red octagon, next to the green flag to stop the script.

Upload Mode

Below is the script in Upload mode. All you need to do is replace the when flag clicked block with the when evive starts up block.

Controlling evive's Potentiometer_Upload

Conclusion

It this tutorial, you learned how to control evive’s potentiometers in both Stage mode and Upload mode.

Hope you had fun! 🙂

Share this Tutorial
Share on facebook
Facebook
Share on twitter
Twitter
Share on google
Google+
Share on pinterest
Pinterest
Share on reddit
Reddit
Share on print
Print
Related Projects & Tutorials
ldr circuit
How to interface LDR sensor with evive ?
The tutorial will shows how to interface ldr sensor with evive and controlling the led state using the sensor.How does ldr sensor works? How to control lights using ldr sensor? All the answers are given in this tutorial.Let's begin...
How to interface Water Flow sensor with evive
In this tutorial, we will discuss how to interface water flow sensor with evive. How water flow rate, current water flowing and output water changes? The water flow rate in liters per hour, current water flowing and output water flowing data flowed since starting is displayed on the screen. All the answers are given in this tutorial.LET'S BEGIN...
All articles loaded
No more articles to load
Featured Projects
DIY Mini Safe Locker Using Servo
DIY Mini Safe Locker Using Servo

Make your own DIY mini-safe locker using components from the evive Starter Kit and control it using evive’s slide switch!

All articles loaded
No more articles to load

Leave a Reply

Close Menu
×

Cart