![]() ![]() inAndOut() //lights the two middle LEDs then moves them out then back former off (one LED will look like it is scrolling oneOnAtATime() //this will turn one LED on then turn the next one OneAfterAnotherLoop ( ) //does the same as oneAfterAnotherNoLoop but with oneAfterAnotherNoLoop() //this will turn on each LED one by one then turn each off Untuk merubah program agar menjalankan baris kedua, rubah kode program menjadi seperti berikut ini: Ini artinya baris kode tersebut dianggap sebagai komentar (comment) dan tidak akan dijalakan oleh program. Perhatikan kode pada baris void loop(), di dalamnya terdapat 4 baris kode. Int offLED2 = 4 + offLED //turns off the LED we turned on last timeĭigitalWrite (ledPins, HIGH ) ĭigitalWrite (ledPins, LOW ) ![]() Int offLED1 = 3 - offLED //turns off the LED we turned on last time Int onLED2 = 4 + i //this is the first LED to go on ie. Int onLED1 = 3 - i //this is the first LED to go on ie. instead we turn off LED 7, (looping around) #define BME_CS 5*/ # define SEALEVELPRESSURE_HPA (1013.Int ledPins = //however if i = 0 we don't want to turn of led -1 (doesn't exist) Load Wi-Fi library # include # include # include # include //uncomment the following lines if you're using SPI /*#include ![]() if you know the current sea level pressure which will you can get a more precise measurement of altitude Serial.print(bmp.readSealevelPressure()) Serial.print("Pressure at sealevel (calculated) = ") ![]() Calculate altitude assuming 'standard' barometric Serial.println("Could not find a valid BMP085 sensor, check wiring!") XCLR is a reset pin, also not used here EOC is not used, it signifies an end of conversion Connect SDA to i2c data - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 4 Connect SCL to i2c clock - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 5 Connect VCC of the BMP085 sensor to 3.3V (NOT 5.0V!) Written by Limor Fried/Ladyada for Adafruit Industries.īSD license, all text above must be included in any redistribution Please support Adafruit and open-source hardware by purchasing These pressure and temperature sensors use I2C to communicate, 2 pinsĪdafruit invests time and resources providing this open source code, This is an example for the BMP085 Barometric Pressure & Temp Sensorĭesigned specifically to work with the Adafruit BMP085 Breakout ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |