Author Archives: sandrapeso

Sandra Peso FINAL Project – Who Wants to Have a Sugar High?

 

 ImageImage

 

#include “pitches.h”

int analogpin[6]={A0,A1,A2,A3,A4,A5};
int buzpin=8;
int threshold=70;

void setup()
{
Serial.begin(9600);
}

void loop()
{
if(analogRead(analogpin[0])>threshold)
{
Serial.println(“A0”);
tone(8, NOTE_B4,1000/4); 
}
if (analogRead(analogpin[1])>threshold)
{
Serial.println(“A1”);
tone(8, NOTE_D4,1000/4);
}
if (analogRead(analogpin[2])>threshold)
{
Serial.println(“A2”); 
tone(8, NOTE_C4,1000/4);
}
if (analogRead(analogpin[3])>threshold)
{
Serial.println(“A3”); 
tone(8, NOTE_G4,1000/4);
}
if (analogRead(analogpin[4])>threshold)
{
Serial.println(“A4”); 
tone(8, NOTE_D3,1000/4);
}
if (analogRead(analogpin[5])>threshold)
{
Serial.println(“A5”); 
tone(8, NOTE_G3,1000/4);
}

}

Leave a comment

Filed under Uncategorized

oF HW – Sandra

https://vimeo.com/79987742

Leave a comment

by | November 21, 2013 · 11:05 am

Midterm Arduino – Sandra

https://vimeo.com/79987355

Get a daily random inspiration!

Leave a comment

by | November 21, 2013 · 10:57 am

Sandra hw – LED using sensor

https://vimeo.com/78112136

 

Leave a comment

Filed under Uncategorized

Arduino Button&LED- Sandra

https://vimeo.com/76981681

Leave a comment

by | October 15, 2013 · 2:36 pm

SANDRA API hw

<!DOCTYPE html>
<html>
<head>
<meta charset=”UTF-8″>
<title>JSON WITH API: Astronomy 1</title>

<script type=”text/javascript” src=”js/jquery-1.10.2.min.js”></script>

<script type=”text/javascript”>

$(document).ready(function(){
$.ajax({
url: “http://api.wunderground.com/api/510617ed01473205/astronomy/q/CA/San_Francisco.json&#8221;,
dataType : “jsonp”,
success : function(parsed_json) {

var nameOfStorm = parsed_json[‘stormInfo’][‘stormName’];

console.log(“storm name = “+nameOfStorm);

}
});
});

 

</script>

</head>

<body>
<section id=”container”>

</section>
</body>
</html>

Leave a comment

Filed under Uncategorized

Canvas HW – Sandra Peso

<html>
<head>

<script type=”application/javascript”>

 

function draw() {

var canvas = document.getElementById(“awesomeCanvas”);
if (canvas.getContext) {
var ctx = canvas.getContext(“2d”);

ctx.fillStyle=”FFCF5F”;
ctx.fillRect(0,0,299,299);
ctx.fillStyle=”FF849B”;
ctx.fillRect(0,300,299,299);
ctx.fillStyle=”7ECEFF”;
ctx.fillRect(0,600,299,299);
ctx.fillStyle=”D3FFE3″;
ctx.fillRect(300,0,299,299);
ctx.fillStyle=”FF7D71″;
ctx.fillRect(300,300,299,299);
ctx.fillStyle=”FF9AEF”;
ctx.fillRect(300,600,299,299);
ctx.fillStyle=”96B8E8″;
ctx.fillRect(600,0,299,299);
ctx.fillStyle=”ADE8D0″;
ctx.fillRect(600,300,299,299);
ctx.fillStyle=”FFF378″;
ctx.fillRect(600,600,299,299);

}
}

function drawing1() {

var canvas = document.getElementById(“awesomeCanvas”);
if (canvas.getContext) {
var ctx = canvas.getContext(“2d”);

var img=document.getElementById(“puppy1”);
ctx.drawImage(img,25,65);
}
}

function drawing2() {

var canvas = document.getElementById(“awesomeCanvas”);
if (canvas.getContext) {
var ctx = canvas.getContext(“2d”);

var img=document.getElementById(“puppy2”);
ctx.drawImage(img,325,65);
}
}

function drawing3() {

var canvas = document.getElementById(“awesomeCanvas”);
if (canvas.getContext) {
var ctx = canvas.getContext(“2d”);

var img=document.getElementById(“puppy3”);
ctx.drawImage(img,625,65);
}
}

function drawing4() {

var canvas = document.getElementById(“awesomeCanvas”);
if (canvas.getContext) {
var ctx = canvas.getContext(“2d”);

var img=document.getElementById(“puppy4”);
ctx.drawImage(img,25,365);
}
}

function drawing5() {

var canvas = document.getElementById(“awesomeCanvas”);
if (canvas.getContext) {
var ctx = canvas.getContext(“2d”);

var img=document.getElementById(“puppy5”);
ctx.drawImage(img,335,310);
}
}

function drawing6() {

var canvas = document.getElementById(“awesomeCanvas”);
if (canvas.getContext) {
var ctx = canvas.getContext(“2d”);

var img=document.getElementById(“puppy6”);
ctx.drawImage(img,625,365);
}
}

function drawing7() {

var canvas = document.getElementById(“awesomeCanvas”);
if (canvas.getContext) {
var ctx = canvas.getContext(“2d”);

var img=document.getElementById(“puppy7”);
ctx.drawImage(img,25,665);
}
}

function drawing8() {

var canvas = document.getElementById(“awesomeCanvas”);
if (canvas.getContext) {
var ctx = canvas.getContext(“2d”);

var img=document.getElementById(“puppy8”);
ctx.drawImage(img,325,665);
}
}

function drawing9() {

var canvas = document.getElementById(“awesomeCanvas”);
if (canvas.getContext) {
var ctx = canvas.getContext(“2d”);

var img=document.getElementById(“puppy9”);
ctx.drawImage(img,625,665);
}
}

 

</script>

</head>

<body onload= “draw();”>

<button onclick=”drawing1()”>cutiepie</button>
<button onclick=”drawing2()”>sweetcheeks</button>
<button onclick=”drawing3()”>honeybunny</button>
<button onclick=”drawing4()”>babycakes</button>
<button onclick=”drawing5()”>woof</button>
<button onclick=”drawing6()”>birdie</button>
<button onclick=”drawing7()”>tweety</button>
<button onclick=”drawing8()”>pumpkin</button>
<button onclick=”drawing9()”>babydoll</button>

<canvas id=”awesomeCanvas” width=”900″ height=”900″></canvas>
<div><img id=”puppy1″ src=”puppy1.jpg”></div>
<img id=”puppy2″ src=”puppy2.jpg” >
<img id=”puppy3″ src=”puppy3.jpg” >
<img id=”puppy4″ src=”puppy4.jpg” >
<img id=”puppy5″ src=”puppy5.jpg” >
<img id=”puppy6″ src=”puppy6.jpg” >
<img id=”puppy7″ src=”puppy7.jpg” >
<img id=”puppy8″ src=”puppy8.jpg” >
<img id=”puppy9″ src=”puppy9.jpg” >

</body>

</html>

 

Screen Shot 2013-09-10 at 12.41.15 AM Screen Shot 2013-09-10 at 12.43.40 AM

Leave a comment

Filed under Homework

Sandra Peso Assignment 1

<!DOCTYPE html>
<html>
<head>
<title>My Basic HTML</title>
</head>
<body>
<script type=”text/javascript”>
console.log(“This is javascripts println();”);
var verb = “sees”;
var verb2 = “looks”;
var adj = “tense”;
var adj2 = “sweet”;
var noun = “chair”;
var noun2 = “table”;
console.log(“The “+noun+” “+verb2+” “+adj2+” while the “+noun+” “+verb+” “+adj+”.”)
</script>
</body>
</html>

1 Comment

Filed under Homework