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: FXOS8700CQ FXAS21000 MBed_Adafruit-GPS-Library Hexi_OLED_SSD1351 Hexi_KW40Z Madgwick
Fork of Hexi_Blinky_Example by
Revision 16:2e42284011d9, committed 2016-08-18
- Comitter:
- whatnick
- Date:
- Thu Aug 18 07:19:49 2016 +0000
- Parent:
- 15:b5a3e22d706b
- Child:
- 17:d30e11e60dba
- Commit message:
- Somewhat working OLED display (writing is flipped)
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adafruit_GFX_1351.lib Thu Aug 18 07:19:49 2016 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/ELLA-Robotics-Inc/code/Adafruit_GFX_1351/#0a4bb1070fd5
--- a/main.cpp Mon Aug 15 06:42:19 2016 +0000
+++ b/main.cpp Thu Aug 18 07:19:49 2016 +0000
@@ -2,13 +2,23 @@
#include "FXOS8700Q.h"
#include "FXAS21000.h"
#include "MBed_Adafruit_GPS.h"
-#include "NeatGUI.h"
+#include "Adafruit_SSD1351.h"
+//#include "NeatGUI.h"
-DigitalOut myled(LED3);
+DigitalOut myled(LED1);
+DigitalOut BOOSTEN(PTC13); //oled power enable
+
Serial gps(PTD3,PTD2);
Serial pc(USBTX, USBRX);
-SSD1351_SPI OLED128(PTB22,PTB23,PTB21,PTB20,PTD15); //Hexiwear pins for SPI bus OLED (MOSI, MISO, SCK, CS, DC)
+//SSD1351_SPI OLED96(PTB22,PTB23,PTB21,PTB20,PTD15); //Hexiwear pins for SPI bus OLED (MOSI, MISO, SCK, CS, DC)
+Adafruit_SSD1351 OLED96(PTB20,PTE6,PTD15,PTB21,PTB22); //Hexiwear pins for SPI bus OLED (CS, RS, DC, SCK, MOSI, MISO);
+
+//#define BLACK 0x000000
+//#define WHITE 0xFFFFFF
+#define GREEN 0x00FF00
+#define RED 0xFF0000
+#define BLUE 0x0000FF
FXOS8700Q_acc acc( PTC11, PTC10, FXOS8700CQ_SLAVE_ADDR0); // Proper Ports and I2C Address for Hexiwear
FXOS8700Q_mag mag( PTC11, PTC10, FXOS8700CQ_SLAVE_ADDR0); // Proper Ports and I2C Address for Hexiwear
@@ -42,19 +52,42 @@
myGPS.sendCommand(UBX_DISABLE_GSA);
-
-pc.baud(115200);
+pc.baud(9600);
acc.enable();
pc.printf("\r\n\nFXOS8700Q Who Am I= %X\r\n", acc.whoAmI());
pc.printf("\r\n\nFXAS21000 Who Am I= %X\r\n", gyro.getWhoAmI());
-OLED128.open();
-OLED128.state(Display::DISPLAY_ON);
-OLED128.drawCircle(10,10,5,0xff345463);
-OLED128.flush();
+BOOSTEN = 1;
+
+OLED96.begin();
+//OLED96.invert(true);
+OLED96.setRotation(0);
+OLED96.setTextColor(OLED96.Color565(0,255,0));
+OLED96.setTextWrap(true);
+OLED96.on();
+OLED96.fillScreen(BLACK);
+wait(0.5);
+OLED96.printf(" Hello from Hexi");
+OLED96.drawPixel(0,0,GREEN);
+OLED96.drawPixel(64,64,RED);
+OLED96.drawPixel(0,64,BLUE);
+OLED96.drawPixel(64,0,WHITE);
+wait(0.5);
+
+/*
+OLED96.open();
+OLED96.state(Display::DISPLAY_ON);
+OLED96.drawCircle(10,10,5,0xFFFFFFFF);
+OLED96.flush();
+wait(2.0);
+*/
+//OLED128.state(Display::DISPLAY_OFF);
+
+//BOOSTEN = 0;
while (true) {
+
acc.getAxis(acc_data);
mag.getAxis(mag_data);
gyro.ReadXYZ(gyro_data);
@@ -82,6 +115,7 @@
pc.printf("FXOS8700Q ACC: X=%d Y=%d Z=%d ", raX, raY, raZ);
pc.printf(" MAG: X=%d Y=%d Z=%d\r\n\n", rmX, rmY, rmZ);
+ /*
while(gps.readable())
{
c = myGPS.read(); //queries the GPS
@@ -97,6 +131,7 @@
continue;
}
}
+ */
wait(0.1);
}
--- a/mbed-os.lib Mon Aug 15 06:42:19 2016 +0000 +++ b/mbed-os.lib Thu Aug 18 07:19:49 2016 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#0712b8adf6bbc7eb796d5dac26f95d79d40745ef +https://github.com/ARMmbed/mbed-os/#0993ae540c5c4b5ce3004bead1aefc0c6d1b3ea0
