Things used in this project

Hardware components:
Cutout cortado grande
Punch Through LightBlue Bean
×1
Software apps and online services:
Punch Through Bean Loader
Ide web
Arduino IDE
Hand tools and fabrication machines:
09507 01
Soldering iron (generic)
Pliers

Code

CodePlain text
#define BLEVEL 255
#define MINLEVEL 50

void setup() {
  Serial.begin(57600);
  pinMode(0, OUTPUT);
  pinMode(2, OUTPUT);
  digitalWrite(0, LOW);
}

void loop() {
  digitalWrite(0, HIGH);
  delay(10);
  int sensorValue = analogRead(A1);
  int r, g, b;
  if (sensorValue > MINLEVEL && sensorValue < BLEVEL + 1) {
    g = (sensorValue - MINLEVEL) / 2;
    b = 0;
  } else if (sensorValue > BLEVEL) {
      g = sensorValue - MINLEVEL;
      if (g > 255) {
        g = 255;
      }
      b = sensorValue - BLEVEL;
      if (b > 255) {
        b = 255;
      }
    } else {
      g = 0;
      b = 0;
    }
  Bean.setLed(0, g, b);
  tone(2, 300 + sensorValue * 10, 20);
}

Credits

11014907 917762441613247 2463536654633089299 o
Punch Through

We’ve been building connected products since 2009. Our diverse team has expertise in every layer from hardware to software to web.

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Controlling 2 Motors with Bean+ and TB6612FNG
Intermediate
  • 24
  • 1

This project aims to demonstrate the operation of the TB6612FNG drive together with the Bean+ to control two DC motors trough an iPhone app.

Web-controlled BoE-Shield Robot with the LightBlue Bean[+]
Intermediate
  • 809
  • 21

Full instructions

Have you ever wanted to control a robot from a web browser? Use the LightBlue Bean[+] (LBB[+]) to control a BoE-Shield Robot using BLE.

El Wire T-shirt: Connected to a LightBlue Bean
Intermediate
  • 182
  • 6

Work in progress

A custom Internet connected shirt using a LightBlue Bean to light up the shirt's El Wire graphics.

RadBit
Intermediate
  • 1,050
  • 18

FitBit-type Bluetooth radiation sensor for tracking radiation exposure (for working around X-rays in the hospital, or just life in general).

Handy BLE app / Bean Car
Intermediate
  • 4,091
  • 29

Work in progress

Remote control bean powered car driven with an iPhone running the Handy BLE app.

Data Pyrotechnics
Intermediate
  • 540
  • 7

Full instructions

What happens when you strap a LightBlue Bean to some fireworks?

Add projectSign up / Login