Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@0:deb3f7947394, 2010-04-16 (annotated)
- Committer:
- chris
- Date:
- Fri Apr 16 13:28:53 2010 +0000
- Revision:
- 0:deb3f7947394
- Child:
- 1:bd3f6bfeebac
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| chris | 0:deb3f7947394 | 1 | #include "mbed.h" |
| chris | 0:deb3f7947394 | 2 | |
| chris | 0:deb3f7947394 | 3 | I2C i2c (p28,p27); |
| chris | 0:deb3f7947394 | 4 | |
| chris | 0:deb3f7947394 | 5 | int main() { |
| chris | 0:deb3f7947394 | 6 | |
| chris | 0:deb3f7947394 | 7 | char i2c_data[2]; |
| chris | 0:deb3f7947394 | 8 | |
| chris | 0:deb3f7947394 | 9 | while (1) { |
| chris | 0:deb3f7947394 | 10 | i2c_data[0] = 6; // LS0 register |
| chris | 0:deb3f7947394 | 11 | i2c_data[1] = 0x0; // all off |
| chris | 0:deb3f7947394 | 12 | i2c.write(0xc0,i2c_data,2); |
| chris | 0:deb3f7947394 | 13 | wait(0.2); |
| chris | 0:deb3f7947394 | 14 | |
| chris | 0:deb3f7947394 | 15 | i2c_data[0] = 6; // LS0 register |
| chris | 0:deb3f7947394 | 16 | i2c_data[1] = 0x55; // all ON |
| chris | 0:deb3f7947394 | 17 | i2c.write(0xc0,i2c_data,2); |
| chris | 0:deb3f7947394 | 18 | wait(0.2); |
| chris | 0:deb3f7947394 | 19 | } |
| chris | 0:deb3f7947394 | 20 | } |