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.
Dependencies: mbed LiquidCrystal_I2C_for_KL25Z
Revision 2:498f4d75c4bc, committed 2022-04-26
- Comitter:
- micros22eq7
- Date:
- Tue Apr 26 14:12:26 2022 +0000
- Parent:
- 1:5f15147dfad8
- Commit message:
- vf
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Apr 26 05:26:07 2022 +0000
+++ b/main.cpp Tue Apr 26 14:12:26 2022 +0000
@@ -13,12 +13,9 @@
// SCL -> PTC8
// DIR TIPO
LiquidCrystal_I2C lcd(0x4E, 16, 2);
-
I2CSlave slave(I2C_SDA, I2C_SCL);
-
char addr = 0xA0;
-
int main()
{
PwmOut rled(LED1);
@@ -29,10 +26,7 @@
pc.printf("\r\n");
char buf[16];
-
- // Inicia la LCD
- lcd.begin();
-
+ lcd.begin(); // Inicia la LCD
slave.address(addr);
slave.frequency (100000);
@@ -42,7 +36,6 @@
while (1)
{
int i = slave.receive();
-
switch (i) {
case I2CSlave::ReadAddressed:
slave.write(msg, strlen(msg) + 1);
@@ -57,9 +50,9 @@
pc.printf("\rRead Addressed: %s\n", buf);
sscanf(buf, "%f, %f, %f", &x, &y, &z);
- rled = 1.0f - x; //Encender LED interno
- gled = 1.0f - y;
- bled = 1.0f - z;
+ //rled = 1.0f - x; //Encender LED interno
+ //gled = 1.0f - y;
+ //bled = 1.0f - z;
lcd.setCursor(2, 1);
lcd.print(buf);