' Port of Arduino = 1000
' We use UDP
'
'Use Hardware:
' - Arduino UNO R3
' - Arduino Ethernet Shield with W5100 Wiznet Chip
$regfile = "m328pdef.dat"
$crystal = 16000000 '16MHz
$hwstack = 100
$swstack = 100
$framesize = 400
Wait 2
Print
Print "-----START Arduino UNO R3 + Ethernet Shield DEMO-----"
'-------------------------------------------------------------------------------
' Network Hardware
'-------------------------------------------------------------------------------
Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 4 , Noss = 0
Spiinit
Print
Enable Interrupts
'Here you need MAC address, the ip address you like to use, subnet mask, gateway and localport
Config Tcpip = Noint , Mac = 1.1.94.127.1.255 , Ip = 192.168.8.12 , Submask = 255.255.255.0 , Gateway = 192.168.8.10 , Localport = 1000 , Tx = $55 , Rx = $55 , Chip = W5100 , Spi = 1
Do
Wait 1
Loop
End
|