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.
Revision 1:dff8f3f6e852, committed 2020-09-19
- Comitter:
- lucky28
- Date:
- Sat Sep 19 12:45:36 2020 +0000
- Parent:
- 0:72fe4e323c03
- Commit message:
- KRPAI ITB AMG8833 testing
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Sep 12 14:49:48 2020 +0000
+++ b/main.cpp Sat Sep 19 12:45:36 2020 +0000
@@ -1,17 +1,35 @@
#include "mbed.h"
#include "AMG8833.h"
-Adafruit_AMG88xx amg(I2C_SDA, I2C_SCL);
+Serial pc(SERIAL_TX,SERIAL_RX);
+
+Adafruit_AMG88xx amg(PB_3, PB_10);
float pixels[AMG88xx_PIXEL_ARRAY_SIZE];
int main() {
wait(0.01);
- //read all the pixels
- amg.readPixels(pixels);
-
- wait(0.10);
+ while (1) {
+ amg.begin();
+ wait(1) ;
+ //read all the pixels
+ amg.readPixels(pixels);
+
+ for (int i = 0; i < 8; i++){
+ for (int j = 0; j < 8; j++){
+ if(pixels[(i*8) + j] > 40){
+ pc.printf("* ");
+ }
+ else {
+ pc.printf("| ");
+ }
+ }
+ pc.printf("\n\r");
+ }
+ pc.printf("\n\r");
+ pc.printf("\n\r");
+ }
}