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: C12832_mod LM75B MMA7660 mbed-src
Fork of GR-PEACH_blinky by
main.cpp
00001 #include "mbed.h" 00002 #include "C12832.h" 00003 #include "LM75B.h" 00004 #include "MMA7660.h" 00005 00006 C12832 lcd(D11, D13, D12, D7, D10); 00007 AnalogIn pot1(A0); 00008 AnalogIn pot2(A1); 00009 LM75B sensor(I2C_SDA, I2C_SCL); 00010 //MMA7660 acc(I2C_SDA, I2C_SCL); 00011 00012 DigitalOut led_tcik(LED_BLUE); 00013 DigitalOut myled(D8); 00014 PwmOut pwm_led(D9); 00015 PwmOut usr_led(LED_USER); 00016 00017 Ticker ficker; 00018 00019 void flip() { 00020 led_tcik = !led_tcik; 00021 } 00022 00023 int main() { 00024 int cnt = 0; 00025 myled = 1; 00026 ficker.attach(&flip, 1); 00027 00028 lcd.cls(); 00029 lcd.locate(0, 0); 00030 lcd.printf("GR-PEACH & App shield!"); 00031 //printf("GR-PEACH + mbed app shield!\n"); 00032 00033 while(1) { 00034 lcd.locate(0,15); 00035 lcd.printf("Counting: %d", cnt); 00036 00037 lcd.locate(70,15); 00038 lcd.printf("p1=%f", pot1.read()); 00039 lcd.locate(70,15+8); 00040 lcd.printf("p2=%f", pot2.read()); 00041 lcd.locate(20,15+8); 00042 lcd.printf("%8.3f", sensor.read()); 00043 pwm_led = pot1.read(); 00044 usr_led = 1.0f - pot2.read(); 00045 00046 //lcd.locate(0,8); 00047 //lcd.printf("%6.2f, %6.2f, %6.2f\n", acc.x(), acc.y(), acc.z()); 00048 00049 myled = !myled; 00050 cnt++; 00051 wait(0.5); 00052 } 00053 }
Generated on Fri Jul 22 2022 10:37:08 by
1.7.2
