Products

paypal

PayPal provides a safe and secure way to purchase online. We never see your credit card number or store it on our server. You can use your PayPal account or major credit card to process your order online safely. 

Featured Project
 
Raspberry Pi with Speaker and Microphon

This project walks through the steps we followed to get the AI framework PyTorch to run on a Raspberry Pi 4 

St. Patrick's Day "Pinch Detector" With Circuit Playground

St. Patrick's Day "Pinch Detector" With Circuit Playground

St. Patrick's day falls on a Friday this year. Take your Circuit Playground to work, school, or a party and be "that guy" who brings a Pinch Detector.

For this project you will need:

- Circuit Playground

- Data sync cable*

*Make sure it is not a "charge only cable" or you will not be able to upload programs to your Circuit Playground.

clipartfox.com

 

Step 1: Add Circuit Playground to Arduino

Circuit Playground

 

Install a driver, board manager, and library for Circuit Playground.

Complete instructions can be found at our site. Installation tips start at page 17.

 

Step 2: Navigate to "color_sense" Example.

Color_Sense

 

We will be using the "color_sense" program as a base for our project.

File>>
  Examples>>
    Adafruit Circuit Playground>>
      color_sense

Step 3: Adding Tones to the Color_sense Program.

Adding Tones

The color_sense program makes use of the built in Light Sensor on the Circuit Playground and displays the color back on the board's 10 Neo Pixels when either button is pressed.

We will be inserting a few lines of code to make use of the built in Speaker. If the board detects a green color from the Light Sensor it will play a higher pitched "ding-ding-ding" sound. Anything not green will get a lower sounding "ding-dong" sound .

This code compares the intensity of green light to both the red and the blue readings. If green returns the highest value, the 3 dings will sound.

CircuitPlayground.playTone(frequency, duration_milliseconds)

Frequency is measured in Hz.

 

Step 4: Insert Code

Seeing Green Code

 

In the color_sense program navigate to

File>> Save as...>>

Save it under a new name such as "Circuit_SeeingGreen".

Insert code at the bottom, just below the for loop as shown in the picture. Or download the attached code.

if (green > red && green > blue) {

CircuitPlayground.playTone(554, 350);

CircuitPlayground.playTone(0, 50);

CircuitPlayground.playTone(554, 350);

CircuitPlayground.playTone(0, 50);

CircuitPlayground.playTone(554, 500);

}

else {

CircuitPlayground.playTone(290, 350);

CircuitPlayground.playTone(0, 250);

CircuitPlayground.playTone(200, 600);

}

Circuit_SeeingGreen.ino

 
 
A Circuit Playground project designed to detect green for St. Patrick's Day

Copyright 2022 - Zagros Robotics, All Rights Reserved - Please send webpage comments or corrections to webmaster@zagrosrobotics.com - Zagros Robotics,PO Box 460342, St. Louis, MO 63146, info@zagrosrobotics.com for answers to any questions.