Gremlin77 Posted September 22, 2013 Posted September 22, 2013 Hi, as named c:\A10 Just create a folder named A10 in your c:\ directory. is my directory for my tools I programmed for DCS an my simulator. Sorry, not able to change this easily. visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
mr_mojo97 Posted September 22, 2013 Posted September 22, 2013 Ah ok, I thought it was a folder that had to be installed in the Dcs World folder. Thanks MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
mr_mojo97 Posted September 25, 2013 Posted September 25, 2013 Sorry, still got issues here. When I copy HMA's code into the Arduino software I get this error message 'Ethernetserver does not name a type' and the following in red letters Sorry, I'm not a programmer and don't know what any of that gobbledigook means sketch_sep25a:8: error: 'EthernetServer' does not name a type sketch_sep25a:15: error: 'EthernetUDP' does not name a type sketch_sep25a:20: error: 'LiquidCrystal' does not name a type sketch_sep25a.ino: In function 'void setup()': sketch_sep25a:28: error: 'lcd' was not declared in this scope sketch_sep25a:32: error: 'Ethernet' was not declared in this scope sketch_sep25a:34: error: 'Udp' was not declared in this scope As of Arduino 1.0, the Udp class in the Ethernet library has been renamed to EthernetUdp. sketch_sep25a.ino: In function 'void loop()': sketch_sep25a:38: error: 'Udp' was not declared in this scope As of Arduino 1.0, the Udp class in the Ethernet library has been renamed to EthernetUdp. sketch_sep25a:47: error: 'lcd' was not declared in this scope Cheers MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
mr_mojo97 Posted September 25, 2013 Posted September 25, 2013 And this is highlighted in the code EthernetServer server = EthernetServer(80); //port 80 after I click the tick button MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
Hansolo Posted September 25, 2013 Posted September 25, 2013 Hi Mojo, What kind of connection are you running to the Arduino? The small code I made only works if you have an Ethernet shield W5100. The USB is only used for uploading code and power source. If you are doing data transfer connection via USB it will not work :( I can try and compile when I get home from work but haven't had any issues with it. cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
mr_mojo97 Posted September 25, 2013 Posted September 25, 2013 Hi Hans, I'm using info I got from your post here http://forums.eagle.ru/showthread.php?t=100704&highlight=cmsp+arduino&page=3 Including the Arduino and ethernet shield and wired a 16x2 lcd to the shield. Because my router is downstairs I'm having to use an ethernet switch upstairs so not sure if the problem lies here. From the ethernet switch I have one ethernet cable running to my computer and another one to the ethernet shield W5100 and I also have a usb from the Arduino to the computer. The top line on the lcd is being lit up (but without characters). Like in mention in post 28 I can't seem to get the Arduino program you did to work in the Arduino software as it comes up with the error code. It is set up Com3 as that was the default in Device manager, it is also set up as Com3 in Arduino Tools option. Although in the Board drop down menu I'm not sure what to do so maybe this is the fault. Thanks MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
mr_mojo97 Posted September 25, 2013 Posted September 25, 2013 Forget the last line above! MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
mr_mojo97 Posted September 25, 2013 Posted September 25, 2013 Ok, HMA, I've now got your program to be verified and it appears to be uploaded. But still nothing on the lcd. Grr MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
Hansolo Posted September 25, 2013 Posted September 25, 2013 (edited) Hi Mojo, I am glad you got the Arduino to load the program. I have just been trying to recreate the fault but am unable to. It could be that the board was not set for Uno. I tried that with different boards but unfortunately that did recreate the fault your describe, although the upload did come up with a fault. With regard to the missing letters it can be that the 5VDC power supply is not sufficient to drive the board. I am driving my Arduino Uno on a 12VDC power supply. When running on USB power supply then there might not be enought power to drive the LCD. The Uno does get a little hot when running on 12VDC but the recommended power is 7-12VDC. If you have inserted a potentiometer to the contrast then you might be able to get a indication of the letters. I will try and find my notes as I later found out to keep contrast steady and then apply a potentiometer for the backlit function instead. Edit: I have now removed my panel from the pit. I will make you a small diagram of how I have hooked up the backlit function of the LCD, but I don't think I can have it ready until late tomorrow due to work. Will revert Cheers Hans Edited September 25, 2013 by Hansolo Additional info 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
mr_mojo97 Posted September 25, 2013 Posted September 25, 2013 Hi Hans, I figured out it was my fault the Arduino played the error message. When I copied and pasted your program didn't copy the whole code but only from the ////configure///// section!!! As for the correct voltage for powering the Arduino, I've also tried the 9v socket but that makes the lcd switch off for some reason - only the 5v socket seems to work. What would you recommend to increase the voltage to 12v? The lcd I'm using is a black backlit with green characters. I get no lights as such but the top row appear to be working. The 10k pot that I'm using seems more switching off/on rather than dimming the top row. I'll photograph my setup tomorrow if my explanations aren't adequate. I've checked and rechecked the wiring and it seems good. Lastly what I did notice and is of probably obvious importance is that after I set up the arduino program and Gremlins cmsp export program with the same IP address as the one in your code and set the same com4 as in device manager, I do not get the required orange signal light on indicator pin 13 Ps I also tried the 'Hello World' example and could not get that to work either which leads me to believe that my 40 year old brain has taken a leave of absence and can't figure it out! Will try again tomorrow. Honestly though as much fun as it is trying this stuff out, I should really be flying more!!! Thanks Les MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
Hansolo Posted September 26, 2013 Posted September 26, 2013 Hi Les, Ah... that makes sense then. Good troubleshooting :thumbup: The reason only 5VDC works for you might be due to the LCD hardware. If you can obtain the data sheet for the LCD that might be able to tell you what the required power should be. I am applying 12VDC on the round input socket on the UNO, which gives an almost steady 5VDC output on the UNO. After removing my panel yesterday I actually found out that I had removed the contrast potentiometer and inserted fixed resistors instead. Forgotten I had... old brain I guess :lol: The reason you might be getting on/off could be due to the size of your potentiometer. I have attached updated schematics of my setup. As you can se I have two fixed resistors for the contrast and then I have a fixed resistor plus a potentiometer for the backlit. You may not need the two fixed resistors for the contrast as the previous setup I did by applying GND to pin3 should work. The reason for the fixed 1kohm resister attached to the potentiometer is to gette a better adjusting range. You might even use a 2kohm resistor instead because then the potentiometer would be adjusting 2.5-5VDC to the backlit fundction. I will be watching for pictures of your setup. I am sure we can make it work :smilewink: All the best HansArduino LCD setup3.bmp 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
mr_mojo97 Posted September 26, 2013 Posted September 26, 2013 CMSP Hope these pics help Hans. I found a datasheet for a similar lcd (from ebay so I'm sure it'll be the same as mine - it seems like a 5v one but it also requests 5v for the background light- would this make a difference? If there are any other shots you require please let me know MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
Hansolo Posted September 26, 2013 Posted September 26, 2013 Hi Les, I think I have found the problem. It looks like you have connected LCD#4 and LCD#6 to UNO#12 and UNO#11. This is not correct. UNO#10-13 is reserved for Ethernet shield and cannot be used. LCD#4 need to be connected to UNO#9 and LCD#6 to UNO#8. Then I think you are good to go :thumbup: Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
mr_mojo97 Posted September 26, 2013 Posted September 26, 2013 Hi, thanks for looking Hans, however I had also tried that as by your previous photos. No luck I'm afraid. When I try Gremlins export software - get an invalid IP address message but they are both the same on his software and your program. Anything else I could try? MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
Hansolo Posted September 26, 2013 Posted September 26, 2013 Hi Les, The IP address might be another issue so lets set that asside for now. I was just trying to load a small LCD code into my setup and it went abe on me I tried to push reset as this has helped me before but is was getting same bars as you do. Eventually I removed the Ethernet shield and was now able to load a check of the LCD. After reconnecting the Ethernet shield everthing could be loaded again.... Strange. Might be a loose connector. I suggest you try same. Power down and remove the Ethernet shield and connect the LCD the same was as shown in #36 above. Then you power up and load attached Arduino sketch "HelloWorld_modi_for_cmps_setup" (attached rar file) onto the Uno and check if you get "hello, world" in first line and a counting up in second line. If not then the LCD has a bad connection. Once satisfied with the text you power down and reinstall the Ethernet shield. I know it is a little easier for me because my connections to the LCD is also done via a small shield. After power up you should be getting the same readout. If this is also satisfied then you load the "cmps_sketch" unto the UNO. It should now give you "ready" in the first line. When we get this up and running then we look into the IP address. I think that might be a IP conflict saying that the IP has already been used. But one thing at a time :thumbup: Cheers HansArduino_LCD_and_cmps.rar 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
mr_mojo97 Posted September 26, 2013 Posted September 26, 2013 Will try again tomorrow. Now my lcd doesn't come on at all! I removed the ethernet shield and tried the wires direct to the Uno without the potentiometer, tried verifying and uploading both the files you sent which went well but got nothing on the lcd - looks dead now!! I get two red lights on the Uno tho. Is there a chance I may have blown the lcd somehow by bypassing the resistors? Thanks Les MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
Hansolo Posted September 26, 2013 Posted September 26, 2013 Hi Les, I don't think the LCD is blown due to bypassing the resistors. The potentiometer is applying a voltage on LCD pin#3. However if I am not mistaking it is working opposite of what one would expect. If you apply 5VDC on LCD pin #3 there will not be any contrast. If you apply GND (0VDC) on LCD pin#3 then the contrast is max. When loading the LCD test you should once again see led on UNO pin#13. Reason why you did not see it while running cmps code was that pin#13 is used by the Ethernet. Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
mr_mojo97 Posted September 27, 2013 Posted September 27, 2013 Hi again, Hans, still no luck. I tried removing the ethernet shield and plugging the cables directly into the Uno. The Tx and Rx lights come on for a second then go off followed by a red light beside the L (not sure what that is). The Arduino is seen by the computer in USB devices so I assume the drivers have been installed correctly. Cheers Les MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
mr_mojo97 Posted September 27, 2013 Posted September 27, 2013 BREAKTHROUGH HANS!!!!!!!!!!!!!!!!!!!!!!!!! Right ok, I can get the Hello World text and the bottom row shows the time taken in seconds since its been uploaded. This works on both the Arduino and with the shield on. It seems I cannot just open up the Arduino software and install the program from there - I have to open program from the file (which then opens up the Arduino software) if that makes sense?! When I try the other examples though I just get Ready on the lcd. Lcd is not back lit either at the mo, but that can come later. Now I'm all fuzzy inside, what's next? Cheers Les MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
mr_mojo97 Posted September 27, 2013 Posted September 27, 2013 And now I've sorted the backlight. Oh, how the day gets better MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
Hansolo Posted September 27, 2013 Posted September 27, 2013 Wohoo Les. Nice work :thumbup: Sorry for the late reply. Have been busy. Ok then the LCD is up and running. As far as I understood the IP conflict you got was from the Gremlin program. Then I suggets you check the IP adress of your gaming PC. The thing is, and I am no expert here, is that the IP adresses need to be on the same net. My setup asumes that your gaming PC has an ip of 192.168.0.aaa. "aaa" is variable. In case you PC is on a different net it wont work. I am pretty sure that your internal network would be 192.168.0.aaa. Let me know what it is. If the PC IP is on a different net then we have to change the Arduino code and Gremlin's IP also Secondly we need to check is you can reach the Arduino Uno. Easiest way to do this is to press windows icon in lower left corner of your PC, then type cmd in the avialable field and select cmd from the search list. You are now in DOS. If you already know all this then please disregard info. Type: ping 192.168.0.100 and press enter Now PC will check if it can reach your Arduino board. If not then there might be an issue with your network. IP could already be used or the way it is set up. One note for you. When the LCD states "ready" it means that it Aruino is ready to recieve UDP packages. When the Gremlin SW is startes and everything is correct then the LCD will go blank again. Reason is that when A-10C is not powered up then the packages contain notihing thus nothing is displayed on the LCD. Looking forward to hear from you. Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
mr_mojo97 Posted September 28, 2013 Posted September 28, 2013 Hi Hans, my IP address is 192.168.0.6 Actually it mentions 2 IPv4 address is 192.168.0.6 (ethernet switch?) Default gateway 192.168.0.1 When ping 192.168.0.100 is entered I get the following: Reply from 192.168.0.6 Destination host unreachable Reply from 192.168.0.6 Destination host unreachable Reply from 192.168.0.6 Destination host unreachable Reply from 192.168.0.6 Destination host unreachable Ping statistics packets : sent = 4, received = 4, lost = 0 Cheers Les MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
Hansolo Posted September 28, 2013 Posted September 28, 2013 Thanks Les, ... Actually it mentions 2 IPv4 address is 192.168.0.6 (ethernet switch?).... Not sure I understand this. Anyway since you are running a IP 192.168.0.xxx then the Arduino UNO CMSP in my setup will not show up. You need to use the Arduino programming software and change the IP address I set in the system (192.168.1.100) and change into your system e.g. 192.168.0.100. This is the line after changing: byte ip[] = { 192, 168, 0, 100 }; //Manual setup only And upload to the Arduino of cause :smartass: Once done you should be able to ping the Arduino using it the new IP adress. Once you get this up and running then you also need to change the IP on the export tool as well. The export tool need to know where to send the information. Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
mr_mojo97 Posted September 28, 2013 Posted September 28, 2013 CMSP Hi Hans, Ok, I got a good ping in cmd after changing the IP address in the Arduino software. But when I try and load up Gremlins export software I get this same message 'Invalid IP address'. MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case | Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |
overpro Posted September 28, 2013 Posted September 28, 2013 Thanks Les, Not sure I understand this. Anyway since you are running a IP 192.168.0.xxx then the Arduino UNO CMSP in my setup will not show up. You need to use the Arduino programming software and change the IP address I set in the system (192.168.1.100) and change into your system e.g. 192.168.0.100. This is the line after changing: byte ip[] = { 192, 168, 0, 100 }; //Manual setup only And upload to the Arduino of cause :smartass: Once done you should be able to ping the Arduino using it the new IP adress. Once you get this up and running then you also need to change the IP on the export tool as well. The export tool need to know where to send the information. Cheers Hans My solution to the IP conflict issue is store / read the IP and MAC address in EEPROM, the IP just need 4 bytes. IPAddress ip; setup() { byte IP[4]; ReadIPFromEEPROM( IP ); ip = IPAddress( IP[0], IP[1], IP[2], IP[3] ); } void ReadIPFromEEPROM(byte *IP) { IP[0] = EEPROM.read(0); IP[1] = EEPROM.read(1); IP[2] = EEPROM.read(2); IP[3] = EEPROM.read(3); //provide some feedback. char msg[16]; snprintf( msg, 15, "%d.%d.%d.%d", IP[0], IP[1], IP[2], IP[3] ); Serial.println( msg ); } If people want to change their IP address then they can use a Serial Monitor to send some "commands" to Arduino to update the IP or MAC. The implementation is watch the serial port data in the loop() body if there are any, then parse the commands and update the IP or MAC address accordingly. Then press the "Reset" key on the Arduino board to make it live. void loop() { SerialDataLength = Serial.available(); if( SerialDataLength > 0 ) { //parse the command and write EEPROM } overpro = I'm not good at Nintendo Mario and always get "Game over" pretty fast, so over~~pro
Recommended Posts