Smart Bank

Role: Design & Develpoment

Credits: Angela Huitian Chen, Sarah Page, Shiny Hsin-Ning Lee & I

Tools: Processing, Arduino, Flex Sensor Module, LittleBits+IFTTT & After Effects

Date: Mar 2015

This bank records the amount of quarters inside of it as you add it. Then, it keeps a record of the money inside in a google spreadsheet for you!

LittleBits Inventions

            #include "pitches.h"


            // notes in the melody:

            int melody[] = {

              NOTE_AS5, NOTE_FS5}; 


            int noteDurations[] = {

              4, 2};



            int flexPin = A0; //analog pin

            int mp3Pin = A1;

            int ledPin = 9;

            int speakerPin = 5;

            int cloudPin = 1;

            int delaytime = 2;


            void setup() {

              Serial.begin(9600);

              pinMode(flexPin, INPUT);

              pinMode(mp3Pin, INPUT);

              pinMode(ledPin, OUTPUT);

              pinMode(speakerPin, OUTPUT);

              pinMode(cloudPin, OUTPUT);

            }


            void loop(){


              if(digitalRead(flexPin) ==HIGH)

              {

                digitalWrite(ledPin, HIGH);

                digitalWrite(speakerPin, HIGH);

                delay(delaytime);

                digitalWrite(ledPin, LOW);

                digitalWrite(speakerPin, HIGH);

                delay(delaytime);

                

                for (int thisNote = 0; thisNote < 2; thisNote++) {

                  int noteDuration = 1500/noteDurations[thisNote];

                  tone(5, melody[thisNote],noteDuration);

               

                  //pause for the note's duration plus 30 ms:

                  delay(noteDuration +20);

                }

                

                Serial.println(flexPin);

              }

            }