Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20587

BASCOM-AVR : Change W5100 IP , MAC , Gateway , Subnet from file on SD : REPLY

$
0
0
have a look at settcp statement. it is used in the samples too. here is a snippet. [code:1:2603c62852]'The next code is optional. It shows how to change the IP at run time #if Epr = 1 Dim Xx As Eram Long ' this is 4 bytes of EEPROM Dim Zz As Long ' this is a long Zz = Xx ' read eeprom Dim B4 As Byte B4 = 8 'use maketcp to create an IP number 'notice that last param is a variable. 'all bytes could be variables of course Zz = Maketcp(192 , 168 , 0 , B4) 'in reverse order Zz = Maketcp(b4 , 9 , 168 , 192 , 1) 'simplest form Zz = Maketcp(192.168.0.8) Print Ip2str(zz) Settcp 12.128.12.34.56.78 , Zz , 255.255.255.0 , 0.0.0.0 ' ^ notice the variable that holds the IP address 192.168.0.8 ' from the EEPROM data line below #endif [/code:1:2603c62852]

Viewing all articles
Browse latest Browse all 20587

Trending Articles