Changeset 11 for trunk/Arduino/projects/OT_boiler
- Timestamp:
- Jul 4, 2019, 12:00:03 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/Arduino/projects/OT_boiler/OT_boiler.ino (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Arduino/projects/OT_boiler/OT_boiler.ino
r10 r11 1 1 #include <SPI.h> 2 2 #include <Ethernet.h> 3 #include < ot_slave_2.h>3 #include <OT_Slave.h> 4 4 5 5 #define CONSOLE(cmd) do { if (Serial) Serial.cmd; } while (0) 6 6 7 void Sent_OT_Data (const O penthermData& data);7 void Sent_OT_Data (const OT_Action& data); 8 8 9 9 byte mac[] = { 0x02, 0xDE, 0xAD, 0xDE, 0xAD, 0x01 }; … … 13 13 volatile bool _connected = false; 14 14 15 OT_ V2R2_Slave boiler(Sent_OT_Data);15 OT_Slave boiler; 16 16 17 17 EthernetClient client; … … 20 20 { 21 21 // Console 22 // Serial.begin(9600);23 22 Serial.begin(19200); 24 /*25 while (!Serial) {26 ; // wait for serial port to connect. Needed for native USB port only27 }28 */29 // if (Serial) Serial.println("\nSystem starting...");30 23 CONSOLE(println("\nSystem starting...")); 31 24 // Setup OT 32 25 CONSOLE(print("OpenTherm.setup...")); 33 boiler. Setup();26 boiler.begin(Sent_OT_Data); 34 27 CONSOLE(println("done")); 35 28 // Setup Ethernet … … 38 31 CONSOLE(println("done")); 39 32 // Check for Ethernet hardware present 33 /* Not needed anymore 40 34 if (Ethernet.hardwareStatus() == EthernetNoHardware) { 41 35 CONSOLE(println("Ethernet shield was not found. Sorry, can't run without hardware. :(")); … … 43 37 delay(1); // do nothing, no point running without Ethernet hardware 44 38 } 45 }46 /*47 if (Ethernet.linkStatus() == LinkOFF) {48 Serial.println("Ethernet cable is not connected.");49 39 } 50 40 */ … … 62 52 */ 63 53 maintainEthernet(); 64 boiler. Loop();54 boiler.maintain(); 65 55 /* 66 56 delay(1000); … … 102 92 } 103 93 104 void Sent_OT_Data (const O penthermData& data)94 void Sent_OT_Data (const OT_Action& data) 105 95 { 106 96 state = OPENTHERM::getMode(); … … 111 101 client.print(state,HEX); 112 102 client.print("]\t"); 103 /* 113 104 client.print(data.type,HEX); 114 105 client.print(":"); … … 118 109 client.print(":"); 119 110 client.print(data.valueLB,HEX); 111 */ 112 uint32_t request = *((uint32_t *)&data.request); 113 client.print(request,HEX); 114 client.print("\t"); 115 uint32_t response = *((uint32_t *)&data.response); 116 client.print(response,HEX); 120 117 client.println(""); 121 118 }
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/trac/Paradigma/chrome/site/paradigma.png)