E-Paper Device (EPD) based MiniNote module, powered by mbed on LPC1114FBD48. Shared in public domain with enclosure in 3D step format, hardware interface compatible with microBUS interface. Anyone can contribute on this project.

Dependencies:   mbed _24LCXXX

E-Badge MiniNote Project on mbed/NXP LPC1114 platform

main.cpp

Committer:
allankliu
Date:
2014-06-01
Revision:
0:33994cfad0c2
Child:
2:bb9f154ea2f4

File content as of revision 0:33994cfad0c2:

#include "mbed.h"
//#include "ssd1306.h"
#include "ssd1606.h"
#include "Ebadge.h"

#define STX 0x02
#define ETX 0x03
#define DISPWIDTH       172
#define DISPHEIGHT  72
#define DISPBPP     2
#define DISPBUFSIZE DISPWIDTH * DISPHEIGHT * DISPBPP / 8

// naked LPC1114 on breadboard, install LED pin28, pasive piezo-buzzer pin1
DigitalOut myled(dp28);  // LED ... P0_7 (pin 28)
Serial uart(dp16, dp15); // UART .. P1_7: TX (pin 16), P1_6: RX (pin 15)
PwmOut pwm(dp1);         // PWM ... P0_8: CT16B0_MAT0 (pin1); sorry, blocking SPI!  


uint16_t xmtptr;
uint16_t xmtsize;

//SSD1306 display(dp2,dp4,dp5,dp6,dp10);
// SSD1606(cs, rst, dc, clk, busy, data);
SSD1606 display(P0_6,P0_7,P2_0,P1_10,P1_5,P1_11);

char c;

void setup() {
    //char c = '0';
  pwm.period(0.001);  // PWM period 1ms (1kHz)   
  uart.baud(115200);  // Baud rate
  uart.puts("\n\rE-Badge Demo\n\r");
}

void loop() {
        if (uart.readable()) {
            c = uart.getc();
            uart.putc(c);
            }
}

int main() {
    setup();
    
  while(1) {    // repeat (period 1sec)
        /*
    myled = 0;  // LED on
    pwm = 0.5;  // PWM duty cycle 50%, tone 1kHz
    wait(0.5);
    uart.putc(c++); if (c > '9') c = '0';  // Put Character & rotate 0,1,2,... 9
    myled = 1;  // LED off
    pwm = 0;    // PWM stop, silent
    wait(0.5);
    uart.puts(" Hello world.\n\r");  // Put String "Hello..."
        */
        loop();
    }       
}