freedom board datacomm
Dependencies: DataCommClassVersion mbed
main.cpp@0:8fdce6f6ce99, 2015-03-23 (annotated)
- Committer:
- askksa12543
- Date:
- Mon Mar 23 14:47:50 2015 +0000
- Revision:
- 0:8fdce6f6ce99
1st
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
askksa12543 | 0:8fdce6f6ce99 | 1 | #include "mbed.h" |
askksa12543 | 0:8fdce6f6ce99 | 2 | #include "DataComm.h" |
askksa12543 | 0:8fdce6f6ce99 | 3 | |
askksa12543 | 0:8fdce6f6ce99 | 4 | DataComm test; |
askksa12543 | 0:8fdce6f6ce99 | 5 | char data[4] = "Hi!"; |
askksa12543 | 0:8fdce6f6ce99 | 6 | int i=1000; |
askksa12543 | 0:8fdce6f6ce99 | 7 | |
askksa12543 | 0:8fdce6f6ce99 | 8 | int main() |
askksa12543 | 0:8fdce6f6ce99 | 9 | { |
askksa12543 | 0:8fdce6f6ce99 | 10 | //set up the output |
askksa12543 | 0:8fdce6f6ce99 | 11 | test.setClockIn(D8); //clock out pin |
askksa12543 | 0:8fdce6f6ce99 | 12 | test.setSerialIn(D7); //data out pin |
askksa12543 | 0:8fdce6f6ce99 | 13 | test.setClock(i); //set clock timing |
askksa12543 | 0:8fdce6f6ce99 | 14 | test.initiate_connection(); //send preamble |
askksa12543 | 0:8fdce6f6ce99 | 15 | test.send_data(data, 3); |
askksa12543 | 0:8fdce6f6ce99 | 16 | } |