STS2 MBED lycee victor hugo Besancon
Dependencies: EthernetInterface mbed-rtos mbed
main.cpp@0:ce84113bb913, 2015-03-24 (annotated)
- Committer:
- schnf30
- Date:
- Tue Mar 24 09:30:11 2015 +0000
- Revision:
- 0:ce84113bb913
Ok
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
schnf30 | 0:ce84113bb913 | 1 | #include "mbed.h" |
schnf30 | 0:ce84113bb913 | 2 | #include "EthernetInterface.h" |
schnf30 | 0:ce84113bb913 | 3 | static const char* mbedIp = "192.168.1.102"; //IP |
schnf30 | 0:ce84113bb913 | 4 | static const char* mbedMask = "255.255.255.0"; // Mask |
schnf30 | 0:ce84113bb913 | 5 | static const char* mbedGateway = "192.168.1.1"; //Gateway |
schnf30 | 0:ce84113bb913 | 6 | |
schnf30 | 0:ce84113bb913 | 7 | |
schnf30 | 0:ce84113bb913 | 8 | |
schnf30 | 0:ce84113bb913 | 9 | int main() { |
schnf30 | 0:ce84113bb913 | 10 | EthernetInterface eth; |
schnf30 | 0:ce84113bb913 | 11 | eth.init(mbedIp,mbedMask,mbedGateway); //Use these parameters for static IP |
schnf30 | 0:ce84113bb913 | 12 | eth.connect(); |
schnf30 | 0:ce84113bb913 | 13 | pc.printf("Connected! IP Address is %s\n", eth.getIPAddress()); |
schnf30 | 0:ce84113bb913 | 14 | } |
schnf30 | 0:ce84113bb913 | 15 | |
schnf30 | 0:ce84113bb913 | 16 |