Stock workshop Robotics and Modular Machines:: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
Line 56: Line 56:


1. http://farm9.staticflickr.com/8378/8533538957_ab70265037_m.jpg  2. http://farm9.staticflickr.com/8097/8533538907_fc8fe05d61_m.jpg
1. http://farm9.staticflickr.com/8378/8533538957_ab70265037_m.jpg  2. http://farm9.staticflickr.com/8097/8533538907_fc8fe05d61_m.jpg
3.http://farm9.staticflickr.com/8512/8534646966_8429d10f3d_m.jpg  4.http://farm9.staticflickr.com/8251/8534646916_7406c2a305_m.jpg
3.http://farm9.staticflickr.com/8512/8534646966_8429d10f3d_m.jpg  4.http://farm9.staticflickr.com/8251/8534646916_7406c2a305_m.jpg


5. http://farm9.staticflickr.com/8513/8533538707_91951352b4_m.jpg 6.http://farm9.staticflickr.com/8524/8534646722_55a7a6853d_m.jpg
5. http://farm9.staticflickr.com/8513/8533538707_91951352b4_m.jpg 6.http://farm9.staticflickr.com/8524/8534646722_55a7a6853d_m.jpg
7.http://farm9.staticflickr.com/8227/8534646606_f236361e0a_m.jpg
7.http://farm9.staticflickr.com/8227/8534646606_f236361e0a_m.jpg

Revision as of 18:21, 6 March 2013

Robotics and Modular Machines

learning process

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