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.
I2CTester.cpp
00001 #include "mbed.h" 00002 #include "PCF8575.h" 00003 00004 Serial pc(USBTX, USBRX); // tx, rx 00005 00006 //SETUP AND INITIAL DEFINITION 00007 PCF8575 IC(p9, p10, 0x40); // 0x40 means the A0-2 is LOW 00008 PCF8575 IC2(p9, p10, 0x44); // 0x42 means the A0 is HIGH and A1-2 is LOW 00009 DigitalOut myled(LED1); 00010 00011 char seventeen = 0xFF00; 00012 int sixteen = 0x4000; 00013 int fifteen = 0x2000; 00014 int fourteen = 0x1000; 00015 int thirteen = 0x0800; 00016 int twelve = 0x0400; 00017 int eleven = 0x0200; 00018 int ten = 0x0100; 00019 int seven = 0x0080; 00020 int six = 0x0040; 00021 int five = 0x0020; 00022 int four = 0x0010; 00023 int three = 0x0008; 00024 int two = 0x0004; 00025 int one = 0x0002; 00026 int zero = 0x0001; 00027 00028 00029 int main() 00030 { 00031 pc.printf("Start"); 00032 while (1) { 00033 IC.write(seventeen); 00034 IC.write(zero); 00035 00036 00037 //IC2.write(0xFFFF); 00038 myled = 1; 00039 00040 00041 wait(1); 00042 00043 IC.write(0x0000); 00044 //IC2.write(0x0000); 00045 myled=0; 00046 wait(1); 00047 00048 } 00049 }
Generated on Sun Jul 24 2022 12:43:13 by
1.7.2