Stock workshop Robotics and Modular Machines:: Difference between revisions

From XPUB & Lens-Based wiki
Line 33: Line 33:


[[image:volumecontrol.JPG|500px]]
[[image:volumecontrol.JPG|500px]]
[[image:hh.JPG|500px]]
[[image:IMG 3174.JPG|500px]]


2. sensors
2. sensors

Revision as of 14:23, 16 March 2013

Robotics and Modular Machines

Hello Arduino!!!

Hello Mr.Stock!!!!

IMG 2885.JPG


code

1. programming logic:

IMG 3115.JPG

IMG 3119.JPG

IMG 3120.JPG

2. the code.

 a.without musical scale
 b,with musical scale

3. c

hardware

1. Arduino nano ( volume control. analog inputs,)

IMG 3194.JPG Nano.JPG

Nano3.JPG Sensors0.JPG

Volumecontrol.JPG IMG 3174.JPG

2. sensors

learning process

1. AC DC

2. H-bridge


document photos...

for optical instrument

code:

//no moter //sensor pin const int ldrPin = A1;

//light pin const int ledPin = 13; //speaker pin const int speakerPin = 9;

void setup(){

Serial.begin(115200);
// using those pins as output
pinMode(ledPin, OUTPUT);
pinMode(speakerPin, OUTPUT);

}


void loop() {

 int ldrVal = analogRead(ldrPin);
 //map the value of the light sensor
 ldrVal = map(ldrVal, 170, 600, 0, 1023);
 //constrain the vaule from 0 to 1023
 ldrVal = constrain(ldrVal, 0, 1023);

// turning on the led

 digitalWrite(ledPin, HIGH);
 Serial.println(ldrVal);
 makeTone(ldrVal);

}

void makeTone(int freq){

   digitalWrite(speakerPin, HIGH);
   delayMicroseconds(freq);
   digitalWrite(speakerPin, LOW);
   delayMicroseconds(freq);

}

Hardware:

IMG 2901.JPG

white board :

1. 8533538957_ab70265037_m.jpg 2. 8533538907_fc8fe05d61_m.jpg 3.8534646966_8429d10f3d_m.jpg 4.8534646916_7406c2a305_m.jpg

5. 8533538707_91951352b4_m.jpg 6.8534646722_55a7a6853d_m.jpg 7.8534646606_f236361e0a_m.jpg