#c: light2
Explore tagged Tumblr posts
Text
(╯。◕‿◕。)╯︵(credit)
2 notes
·
View notes
Photo
How Many Are Your Works, O LORD!
Introduction
1 O Lord my God, you are very great. You are clothed with splendor and majesty.
Day One—Light
2 He wears light like a robe.
Day Two—the Sky
He stretches out the heavens like a canopy.
3 He lays beams on the waters to support his upper chambers. He makes clouds his chariot. He travels on the wings of the wind. 4 He makes his messengers winds. His ministers are blazing fire.
Day Three—the Waters and Plants
5 He placed the earth firmly on its foundations. It cannot be moved forever and ever. 6 You covered it with the deep as a garment. The waters stood above the mountains. 7 At your rebuke they fled. At the sound of your thunder they hurried away. 8 The waters surged up the mountains. They went down into the valleys, to the place that you prepared for them. 9 You set a boundary that they cannot cross. They will not return to cover the earth. 10 He makes springs flow into streams that run between the mountains. 11 They give water to every wild animal. The wild donkeys quench their thirst. 12 The birds of the sky live by the streams. From among the branches they send out their song. 13 He waters the mountains from his upper chambers. The earth is filled with the fruit he produces. 14 He makes grass grow for the cattle, and plants that people use[c] to produce food from the earth. 15 Also wine that makes people’s hearts glad, olive oil to make their face shine, and bread that sustains their lives. 16 The trees of the Lord have everything they need. He planted the cedars of Lebanon, 17 where birds make their nests. The stork has its home in the fir trees. 18 The high mountains are for the wild goats. The crags are a refuge for the rock badgers.
Day Four—the Lights
19 The moon marks off the months and seasons. The sun knows when to go down. 20 You bring darkness, and it becomes night. During it all the animals in the forest move about. 21 The young lions roar for their prey. They are seeking their food from God. 22 The sun rises, and they gather together. They return to their dens and lie down. 23 Man goes out to his work. He continues his labor until evening.
Days Five and Six—Animals and Man
24 How many are your works, O Lord! In wisdom you made them all. The earth is full of your creatures. 25 Here is the sea, great and very wide. In it creatures swarm beyond number— living things, the small with the large. 26 There the ships go back and forth, and the leviathan that you formed to play in it. 27 All of them wait hopefully for you to give them their food in its time. 28 You give it to them. They gather it up. You open your hand. They are satisfied with good things. 29 You hide your face. They are terrified. You take away their breath. They breathe their last and return to their dust. 30 You send your Spirit—they are created. You renew the face of the earth.
Closing Benediction and Prayer
31 May the glory of the Lord endure forever. May the Lord rejoice in his works. 32 He looks at the earth and it trembles. He touches the mountains and they smoke. 33 I will sing to the Lord throughout my life. I will make music to my God as long as I last. 34 May my meditation be pleasing to him. I will rejoice in the Lord. 35 May sinners come to an end on the earth, and the wicked—may they be no more. Bless the Lord, O my soul. Praise the Lord! — Psalm 104 | Evangelical Heritage Version (EHV) The Holy Bible, Evangelical Heritage Version®, EHV®, © 2019 Wartburg Project, Inc. All rights reserved. Cross References: Genesis 1:2; Genesis 1:11; Genesis 1:14; Genesis 1:31; Genesis 3:19; Exodus 19:18; Leviticus 11:5; Deuteronomy 31:17; Deuteronomy 33:26; Job 33:4; Job 37:8; Job 38:10-11; Job 38:27; Job 40:10; Job 40:20; Psalm 5:1; Psalm 8:8; Psalm 18:13; Psalm 29:5; Psalm 33:7; Psalm 50:10; Psalm 63:4; Psalm 65:11; Psalm 107:35; Psalm 111:10; Ecclesiastes 1:4; Isaiah 32:14; Joel 1:20; Amos 3:4; Zechariah 5:9; Matthew 6:26; Matthew 8:20; Luke 7:46; 1 Timothy 6:16; Hebrews 1:7; Revelation 19:1; Revelation 19:3-4
#God's creation#seen#experienced#worship#spirit#truth#Psalm 104#Book of Psalms#Old Testament#EHV#Evangelical Heritage Version Bible#Wartburg Project Inc.
8 notes
·
View notes
Text
WeatherSensor and MusicBox
After getting the bluetooth working, I started putting all the pieces together. I have two arduino circuits, one named ‘WeatherSensor’ and one named ‘MusicBox’. The WeatherSensor is made up of one raindrop sensor, two LDR’s and a HC-05 Module transmitting the data. The MusicBox is, at the moment, one Piezo speaker and a HC-05 Module.
int rain = analogRead(A0); int light1 = analogRead(A1); int light2 = analogRead(A2); int light = (light1 + light2) / 2; Serial1.write(rain); Serial1.write(light); delay(1000); Serial.flush();
I started this development by sending a String containing direct readings from the rain sensor and an average reading of the LDR’s to my phone, just to check the data was sending.
Then I set up the MusicBox to receive this message. The next step was parsing the message into separate readings again. Due to sending String instead of raw int or byte values, this was more complicated than I expected. My prime language is Javascript, so I’m very used to being able to easily manipulate String values. This is not as easy in C, and I had to struggle with splitting and clearing the String message. I did eventually figure out a system, but once I fully understood the Serial Buffer and how it works, I was able to switch to just sending and receiving two integer values which was a lot easier.
if (Serial1.available()) { int val = Serial1.read(); if (alt) { Serial.println(val); rainVal = map(val, 0, 1050, 0, 100); Serial.println(rainVal); alt = false; } else { lightVal = map(val, 0, 30, 0, 100); alt = true; } }
Next I wrote a series of if/else conditions to determine what kind of weather it was depending on the Light and Rain values. Each statement passes different values into the ‘playMelody()’ function, the index of the required melody and the tempo it is to be played at.
//------DECIDE CONDITION //LIGHT LOW + NO RAIN if (lightVal < 50 && rainVal < 30) { Serial.println("CLOUDY"); playMelody(1, 140); // zelda theme } //LIGHT LOW + SOME RAIN else if (lightVal < 50 && rainVal < 60) { Serial.println("DRIZZLE"); playMelody(0, 88); // zeldas lullaby } //LIGHT LOW + LOTS OF RAIN else if (lightVal < 50 && rainVal >= 60) { Serial.println("HEAVY RAIN"); playMelody(4, 85); // jigglypuff song } //LIGHT HIGH + NO RAIN else if (lightVal > 50 && rainVal < 30) { Serial.println("SUNNY"); playMelody(3, 140); // take on me } //LIGHT HIGH + SOME RAIN else if (lightVal > 50 && rainVal < 60) { Serial.println("SUMMER SHOWER"); playMelody(2, 140); // mii channel theme } else { Serial.println("ERROR"); } //light high + lots of rain not included as it is very unlikely to occur
I created a separate header file to contain the arrays of melodies, simply for organisations sake, and created a global constant ‘jagged’ (multidimensional) array called ‘melodies’ to store them. I also created a separate array containing the sizes of these melodies, as the sizeof() function didn’t seem to work on the instances of the ‘melodies’ array. Each of the melodies are from this GitHub https://github.com/robsoncouto/arduino-songs
extern const int* melodies[] = {zelda1, zelda2, miiChannel, takeOnMe, jigglypuff}; extern const int sizes[] = {sizeof(zelda1), sizeof(zelda2), sizeof(miiChannel), sizeof(takeOnMe), sizeof(jigglypuff)};
The playMelody() function is a reworked version of the loop that comes with the melodies from that GitHub, altered a bit to function with the ‘melodies’ array. As it uses the delay, I had a problem with the Serial buffer becoming backlogged with unprocessed values. I added a serial.flush() function to the WeatherSensor code to clear the outgoing buffer each loop and keep only the most current data in it.
void playMelody( int index, int tempo) { int notes = sizes[index] / sizeof(melodies[index][0]) / 2; // this calculates the duration of a whole note in ms (60s/tempo)*4 beats int wholenote = (60000 * 4) / tempo; int divider = 0, noteDuration = 0; for (int thisNote = 0; thisNote < notes * 2; thisNote = thisNote + 2) { // calculates the duration of each note divider = melodies[index][thisNote + 1]; if (divider > 0) { // regular note, just proceed noteDuration = (wholenote) / divider; } else if (divider < 0) { // dotted notes are represented with negative durations!! noteDuration = (wholenote) / abs(divider); noteDuration *= 1.5; // increases the duration in half for dotted notes } Serial.println(melodies[index][thisNote]); // we only play the note for 90% of the duration, leaving 10% as a pause tone(buzzer, melodies[index][thisNote], noteDuration * 0.9); // Wait for the specief duration before playing the next note. delay(noteDuration); // stop the waveform generation before the next note. noTone(buzzer); } Serial.println("end"); }
The next step is to get the project working remotely. I have some batteries, a couple of snap connecters and some barrel connectors arriving soon that I will use.
WeatherSensor
MusicBox
vimeo
Evaluation
I am really happy with how this turned out. It was definitely a fairly complex and long process, but it all works and I’m proud of how far I’ve come. There are just a couple more pieces to add and I will do a full evaluation of circuit, code and general project outcomes then.
0 notes