Because of the corona virus the school was closed. Kim and I diveded tasks We continued at home.
I've written my notes during the class discussion in here, but they are gone now...
Thanks a lot to Kaz for sending me these codes.
Don´t know yet how to rhyme this to the youtube videoclip
https://docs.google.com/document/d/1eXvXrDZ94IPIKxUatRcuwv3Q8BOb3c3OaKpkV3vgDZw/edit#heading=h.cwl4u0cc14wv probably need to use these codes instead, don´t know yet which one
//ARDUINO CODE FOR ANALOG SENSOR int sensorValue = 0;
void setup() { Serial.begin(9600); //needs to match processing baudrate }
void loop() { Serial.println(analogRead(A0)); // for debugging only sensorValue = analogRead(A0); // store value in sensorValue //Serial.println(map(sensorValue, 0,1023,0,255)); // map to processing range delay(50); }
Baud rate can be found in setup: Serial.begin(9600);
Minimum value (waarde) by sensor: 65
Maximum value by sensor: 1.000
//ARDUINO CODE FOR ANALOG SENSOR int sensorValue = 0;
void setup() { Serial.begin(9600); //needs to match processing baudrate }
void loop() { //Serial.println(analogRead(A0)); // for debugging only sensorValue = analogRead(A0); // store value in sensorValue Serial.println(map(sensorValue, 0,1023,0,255)); // map to processing range delay(50); }
Minimum value: 210
Maximum value: 240
Minimum value: Maximum value:
Doesn't seem to change much, eventhough the light reacts as aspected
Eerst hebben we gecheckt wat we allemaal thuis hebben liggen, waar kunnen we mee werken. We kwamen er achter dat ik geen RGB-lampje heb en dus 3 losse lampjes moet gaan gebruiken.
Allereerst kreeg ik deze link https://www.instructables.com/id/Arduino-LDR-With-LED/ hiermee kon ik een circuit maken waarmee ik de sensor kan uitlezen.
Voor de eerste poging heb ik lampje als nog in een circuit gedaan dit klonk op het eerste gezicht logisch, maar klopt niet. Wanneer de lampjes wel in dezelfde baan zitten krijgen ze als nog allemaal "aandacht", dus we gaan een nieuwe variant bouwen.
Ik wist alleen niet wat ik met de sensor moest doen... Wat heeft dat met dit hele circuit te maken?
De resultaten zijn geen mooie vloeiende lijn. Na wat gefriemel bleken niet alle kabels er goed in te zitten.
De afbeelding klopt niet 100%, maar samen met Loes ben ik hier uitgekomen.
int RED_PIN = D2; int GREEN_PIN = D1; int BLUE_PIN = D0;
// This variable controls how fast we loop through the colors. // (Try changing this to make the fading faster or slower.)
int DISPLAY_TIME = 100; // In milliseconds
void setup() { // Here we'll configure the Arduino pins we're using to // drive the LED to be outputs:
pinMode(RED_PIN, OUTPUT); pinMode(GREEN_PIN, OUTPUT); pinMode(BLUE_PIN, OUTPUT); }
void loop(){
// Off (all LEDs off):
digitalWrite(RED_PIN, LOW); digitalWrite(GREEN_PIN, LOW); digitalWrite(BLUE_PIN, LOW);
delay(1000);
// Red (turn just the red LED on):
digitalWrite(RED_PIN, HIGH); digitalWrite(GREEN_PIN, LOW); digitalWrite(BLUE_PIN, LOW);
delay(1000);
// Green (turn just the green LED on):
digitalWrite(RED_PIN, LOW); digitalWrite(GREEN_PIN, HIGH); digitalWrite(BLUE_PIN, LOW);
delay(1000);
// Blue (turn just the blue LED on):
digitalWrite(RED_PIN, LOW); digitalWrite(GREEN_PIN, LOW); digitalWrite(BLUE_PIN, HIGH);
delay(1000);
// Yellow (turn red and green on):
digitalWrite(RED_PIN, HIGH); digitalWrite(GREEN_PIN, HIGH); digitalWrite(BLUE_PIN, LOW);
delay(1000);
// Cyan (turn green and blue on):
digitalWrite(RED_PIN, LOW); digitalWrite(GREEN_PIN, HIGH); digitalWrite(BLUE_PIN, HIGH);
delay(1000);
// Purple (turn red and blue on):
digitalWrite(RED_PIN, HIGH); digitalWrite(GREEN_PIN, LOW); digitalWrite(BLUE_PIN, HIGH);
delay(1000);
// White (turn all the LEDs on):
digitalWrite(RED_PIN, HIGH); digitalWrite(GREEN_PIN, HIGH); digitalWrite(BLUE_PIN, HIGH);
delay(1000); }
Er ging iets mis, maar door Laura is het opgelost. In de code was ik een haakje sluiten vergeten op te schrijven naar de > 666
file:///Applications/Arduino.app/Contents/Java/reference/www.arduino.cc/en/Reference/Else.html
Comparison Operators
Boolean Operators
Finished reading How To Thrive In The Next Economy this week. It has been a good read.
I would like to elaborate on this page a little more (please read on forehand if possible). John Thackara suggest that the current educational system seperates students (childeren, young adults and everything in between; the future) from nature. The timing of reading this has been great, while doing a minor specialised in technology and critical thinking. Two subject how could clash in this case.
I don't draw any conclusion, but I do think this is good to keep in mind.