a vin-ből a boardon levő tápegység csinál tápot. fene tudja mennyire jó az a táp. nagy kondi tuti nincs benne. azért mondják hogy tegyél az +5V-re egy korrekt ötvoltot, mert esélyes hogy a Te tápod jobb mint az a miniatűr ami a boardon van. de lehet hogy egyelőre ha egy jobbfajta 100nF+220uF-et tennél oda, az is segítene.
Sketch uses 28 110 bytes (91%) of program storage space. Maximum is 30 720 bytes. Global variables use 1 399 bytes (68%) of dynamic memory, leaving 649 bytes for local variables. Maximum is 2 048 bytes
/*Arduino Nano, ATmega328 YourDuino.com Example: Multiple DS18B20 Temperature Sensors Displayed on 4x20 character LCD display
DS18B20 Pinout (Left to Right, pins down, flat side toward you) - fekete = Ground - sárga = Signal (Pin 2): (with 3.3K to 4.7K resistor to +5 or 3.3 ) - zöld = +5 or +3.3 V */
#define DS3231_I2C_ADDRESS 0x68 // Convert normal decimal numbers to binary coded decimal byte decToBcd(byte val) { return( (val/10*16) + (val%10) ); } // Convert binary coded decimal to normal decimal numbers byte bcdToDec(byte val) { return( (val/16*10) + (val%16) ); } /*-----( Declare Constants and Pin Numbers )-----*/ // Data wire is plugged into port 2 on the Arduino (can be changed) #define ONE_WIRE_BUS 2 // NOTE: No ";" on #define #define SZV1START 3 // relay1 #define LAKAS1 5 // relay2 #define PUFFER 4 // relay3 #define SZV2START 6 // relay4 #define BYPASS 7 // relay5 #define LAKAS2 8 // relay6 /*-----( Declare objects )-----*/ // Setup a oneWire instance to communicate with any OneWire devices // (not just Maxim/Dallas temperature ICs) OneWire oneWire(ONE_WIRE_BUS);
// Pass address of our oneWire instance to Dallas Temperature. DallasTemperature sensors(&oneWire);
// Start the LCD display library LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 20 chars and 4 line display int LED1 = 13; // Status LED Pin int CS = 10; // CS pin on MAX6675 int SO = 11; // SO pin of MAX6675 int SCLK = 9; // SCLK pin of MAX6675 int units = 1; // Units to readout temp (0 = raw, 1 = ˚C, 2 = ˚F) float fusthofok = 0.0; // Temperature output variable
// Initialize the MAX6675 Library for our chip MAX6675 temp(CS,SO,SCLK,units);
// Setup Serial output and LED Pin // MAX6675 Library already sets pin modes for MAX6675 chip! /*-----( Declare Variables )-----*/ // Assign the addresses of your 1-Wire temp sensors. // See the tutorial on how to obtain these addresses: // http://arduino-info.wikispaces.com/Brick-Temperature-DS18B20#Read%20individual
wdt_disable(); lcd.init(); // initialize the lcd lcd.backlight(); Serial.begin(9600); // set the initial time here: //DS3231 seconds, minutes, hours, day, date, month, year //setDS3231time(30,10,14,3,15,12,15);
//------- Initialize the Temperature measurement library-------------- sensors.begin(); // set the resolution to 10 bit (Can be 9 to 12 bits .. lower is faster) sensors.setResolution(pufferfent, 10); //T1 sensors.setResolution(puffer1_3, 10); //T2 sensors.setResolution(puffer2_3, 10); //T3 sensors.setResolution(pufferlent, 10); //T4 temperature1.start(); temperature2.start(); temperature3.start(); pinMode(LED1, OUTPUT); pinMode(SZV1START, OUTPUT); pinMode(LAKAS1, OUTPUT); pinMode(PUFFER, OUTPUT); pinMode(SZV2START,OUTPUT); pinMode(LAKAS2,OUTPUT); pinMode(BYPASS,OUTPUT); digitalWrite(SZV1START, HIGH); // szv1 áll digitalWrite(LAKAS1, HIGH); digitalWrite(PUFFER, HIGH); // pufferre állítja az irányváltó1-et digitalWrite(SZV2START,HIGH); // szv2 áll digitalWrite(LAKAS2, HIGH); digitalWrite(BYPASS,HIGH); // bypassra állítja irányváltó2-őt
if (SD.exists("datalog.txt")) { Serial.println("datalog.txt exists."); } else { Serial.println("datalog.txt doesn't exist."); } wdt_enable(WDTO_8S); }//--(end setup )--- void setDS3231time(byte second, byte minute, byte hour, byte dayOfWeek, byte dayOfMonth, byte month, byte year) { // sets time and date data to DS3231 Wire.beginTransmission(DS3231_I2C_ADDRESS); Wire.write(0); // set next input to start at the seconds register Wire.write(decToBcd(second)); // set seconds Wire.write(decToBcd(minute)); // set minutes Wire.write(decToBcd(hour)); // set hours Wire.write(decToBcd(dayOfWeek)); // set day of week (1=Sunday, 7=Saturday) Wire.write(decToBcd(dayOfMonth)); // set date (1 to 31) Wire.write(decToBcd(month)); // set month Wire.write(decToBcd(year)); // set year (0 to 99) Wire.endTransmission(); } void readDS3231time(byte *second, byte *minute, byte *hour, byte *dayOfWeek, byte *dayOfMonth, byte *month, byte *year) { Wire.beginTransmission(DS3231_I2C_ADDRESS); Wire.write(0); // set DS3231 register pointer to 00h Wire.endTransmission(); Wire.requestFrom(DS3231_I2C_ADDRESS, 7); // request seven bytes of data from DS3231 starting from register 00h *second = bcdToDec(Wire.read() & 0x7f); *minute = bcdToDec(Wire.read()); *hour = bcdToDec(Wire.read() & 0x3f); *dayOfWeek = bcdToDec(Wire.read()); *dayOfMonth = bcdToDec(Wire.read()); *month = bcdToDec(Wire.read()); *year = bcdToDec(Wire.read()); } /*void displayTime() { byte second, minute, hour, dayOfWeek, dayOfMonth, month, year; // retrieve data from DS3231 readDS3231time(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year); // send it to the serial monitor Serial.print(hour, DEC); // convert the byte variable to a decimal number when displayed Serial.print(":"); if (minute<10) { Serial.print("0"); } Serial.print(minute, DEC); Serial.print(":"); if (second<10) { Serial.print("0"); } Serial.print(second, DEC); Serial.print(" "); Serial.print(dayOfMonth, DEC); Serial.print("/"); Serial.print(month, DEC); Serial.print("/"); Serial.print(year, DEC); Serial.print(" Day of week: "); switch(dayOfWeek){ case 1: Serial.println("Sunday"); break; case 2: Serial.println("Monday"); break; case 3: Serial.println("Tuesday"); break; case 4: Serial.println("Wednesday"); break; case 5: Serial.println("Thursday"); break; case 6: Serial.println("Friday"); break; case 7: Serial.println("Saturday"); break; } }*/
void loop() /****** LOOP: RUNS CONSTANTLY ******/ { byte second, minute, hour, dayOfWeek, dayOfMonth, month, year; // retrieve data from DS3231 readDS3231time(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year); digitalWrite(LED1, HIGH); // turn the LED on (HIGH is the voltage level) delay(100); // wait for a second digitalWrite(LED1, LOW); // turn the LED off by making the voltage LOW delay(100); // wait for a second
// if the file is available, write to it: if (dataFile) { dataFile.println(dataString); dataFile.close(); } // if the file isn't open, pop up an error: else { //Serial.println("error opening datalog.txt"); } delay (100);
"avr-g++: error: CreateProcess: No such file or directory
exit status 1 Hiba a fordítás során."
Ki van választva az Arduino mega 2560 alaplap, az Arduino AVR board 1.6.9 is frissítve. AVR ISP programozás van kiválasztva. Ugyanezekkel a beállításokkal haverom gépén elsőre feltölti a programot (neki win7 van a gépen, talán ennyi a különbség).
Megjelenik rendesen, Com3 portra teszi, felismeri amikor csatlakoztatom. Megpróbálok másik drivert keresni, azért ezt raktam fel, mert ebay-en ezt ajánlották hozzá.