by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
main.cpp@0:90a5426d4de5, 2013-06-16 (annotated)
- Committer:
- robt
- Date:
- Sun Jun 16 15:31:34 2013 +0000
- Revision:
- 0:90a5426d4de5
by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
robt | 0:90a5426d4de5 | 1 | /* Program Example 12.7: Ethernet write |
robt | 0:90a5426d4de5 | 2 | */ |
robt | 0:90a5426d4de5 | 3 | #include "mbed.h" |
robt | 0:90a5426d4de5 | 4 | #include "Ethernet.h" |
robt | 0:90a5426d4de5 | 5 | Ethernet eth; // The Ethernet object |
robt | 0:90a5426d4de5 | 6 | char data[]={0xB9,0x46}; // Define the data values |
robt | 0:90a5426d4de5 | 7 | int main() { |
robt | 0:90a5426d4de5 | 8 | while (1) { |
robt | 0:90a5426d4de5 | 9 | eth.write(data,0x02); // Write the package |
robt | 0:90a5426d4de5 | 10 | eth.send(); // Send the package |
robt | 0:90a5426d4de5 | 11 | wait(0.2); // wait 200 ms |
robt | 0:90a5426d4de5 | 12 | } |
robt | 0:90a5426d4de5 | 13 | } |
robt | 0:90a5426d4de5 | 14 |