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: CANBuffer KS0108_fork mbed-rtos mbed CAN Addresses
Fork of REVO_Updated_Steering by
Screen_Performance_Test.cpp
- Committer:
- jayf
- Date:
- 2015-05-15
- Revision:
- 45:aea289639d6b
- Parent:
- 43:47a3ac562be8
File content as of revision 45:aea289639d6b:
#include "Screen_Performance_Test.h"
int main(){
DigitalOut RST=p26, DI=p21, RW=p22, E=p23, CS2=p25, CS1=p24;
KS0108 screen(p26, p21, p22, p23, p25, p24, p8, p7, p6, p5, p13, p14, p12, p11);
BusInOut DB(p8, p7, p6, p5, p13, p14, p12, p11);
Serial s(USBTX,USBRX);
s.baud(921600);
DB.output();
RW=0;
uint8_t a=170,b=85;
bool toggle=0;
while(1){
Timer t;
t.start();
toggle=!toggle;
CS1=1;
CS2=0;
for(int page=0;page<8;page++){
wait_us(2);
DI=0;
E=1;
DB.write(0xB8|page);
wait_us(1);
E=0;
for(int x=0;x<64;x++){
wait_us(2);
DI=0;
E=1;
DB.write(0x40|x);
wait_us(1);
E=0;
wait_us(2);
DI=1;
E=1;
DB.write((toggle^(x%2))?a:b);
wait_us(1);
E=0;
}
}
CS1=0;
CS2=1;
for(int page=0;page<8;page++){
wait_us(2);
DI=0;
E=1;
DB.write(0xB8|page);
wait_us(1);
E=0;
for(int x=0;x<64;x++){
wait_us(2);
DI=0;
E=1;
DB.write(0x40|x);
wait_us(1);
E=0;
wait_us(2);
DI=1;
E=1;
DB.write((toggle^(x%2))?a:b);
wait_us(1);
E=0;
}
}
t.stop();
float time=t.read();
s.printf("%1.10f\n",time);
wait(.2);
}
}
