Penelope M. Lopez
Published © GPL3+

COVER MY BACK

Save your clothes, energy, and water in a conserve and simple say.

BeginnerWork in progress719
COVER MY BACK

Things used in this project

Story

Read more

Schematics

linkit one board and breadboard

coded in C++ and had to manually install drivers of the port comm from linkitone board on my surface pro 3.

3d printed laundry machine

been created with help of 3d experts, diego and rick from deezmakers. They were able to take the design i made into 3d printable stuff. very small scale to test out idea of laundry machine to be cranked by hand and see if it can be printable.

Code

servo and button

C/C++
/*
  Copyright (c) 2014 MediaTek Inc.  All right reserved.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License..

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
  See the GNU Lesser General Public License for more details.
   
  Note: Only D9 and D10 is supported
*/

#include <Servo.h> 

Servo myservo;
int potpin = 0;
int val;
/*button*/
const int button = 2;
int state = 0;
/*int old val for button to stay on when push on*/
int old_value= 0;
int value = 0;

void setup() 
{
    Serial.begin(115200);
    myservo.attach(9);
    myservo.write(90);
    
    /*button*/
    pinMode(button, INPUT);
}

void loop() 
{
  /*reading the button*/
  value = digitalRead(button);
  
  //check if button is pushed
  if((value == HIGH) && (old_value == LOW))
  {
    state = 1 - state;
    delay(10);
  }
  
  old_value = value;
  if(state == 1)
  {
    //servo gets pushed
    //for(int i=0; i<20; i++)
    //{
        myservo.write(30);
        //delay(1);
    //}
    
  }
 //when button is NOT pushed anymore
 else{ 
    
    //for(int i=179; i>=0; i--)
    //{
        myservo.write(180);//(i);
        //delay(1);
    //}
   
  }// end else
 }//end loop

temp & humidity

C/C++
this is for the temperature sensor and humility used for the waterhack for linkit board with base shield on D9.
// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain

#include "DHT.h"

#define DHTPIN 2     // what pin we're connected to

#define DHTTYPE DHT22   // DHT 22  (AM2302)

DHT dht(DHTPIN, DHTTYPE);


void setup() 
{
    Serial.begin(9600); 
    Serial.println("DHTxx test!");

    dht.begin();
}

void loop() 
{
    // Reading temperature or humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
    
    float t = 0.0;
    float h = 0.0;
    
    if(dht.readHT(&t, &h))
    {
        Serial.println("------------------------------");
        Serial.print("temperature = ");
        Serial.println(t);
        
        Serial.print("humidity = ");
        Serial.println(h);
    }
    
    delay(2000);
}

Credits

Penelope M. Lopez

Penelope M. Lopez

2 projects • 6 followers
Maker, developer, designer, and a twin from east Los Angeles. CalStateLA student

Comments