Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "mcu_regs.h"
- #include "type.h"
- #include "uart.h"
- #include "stdio.h"
- #include "timer32.h"
- #include "i2c.h"
- #include "gpio.h"
- #include "ssp.h"
- #include "adc.h"
- #include "light.h"
- #include "oled.h"
- #include "rgb.h"
- #include "temp.h"
- #include "acc.h"
- #include "led7seg.h"
- #include "pca9532.h"
- #include "joystick.h"
- #define figura 0x00001034
- extern const char * test_bin_symbol;
- int matriz[4][4] = {{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}};
- extern int f_asm(void);
- void updateOLED(int op){
- uint8_t *p = (uint8_t *) figura;
- //oled_clearScreen(OLED_COLOR_WHITE);
- if (op==1){
- for (uint8_t y=0;y<64;y++){
- for (uint8_t x=0;x<96;x++){
- if (*p>128){
- oled_putPixel(x, y, OLED_COLOR_WHITE);
- }
- else
- oled_putPixel(x, y, OLED_COLOR_BLACK);
- //printf("%u\n", *p);
- p+=3;
- }
- }
- }
- else{
- for (uint8_t y=0;y<64;y++){
- for (uint8_t x=0;x<96;x++){
- if (*p<128){
- oled_putPixel(x, y, OLED_COLOR_WHITE);
- }
- else
- oled_putPixel(x, y, OLED_COLOR_BLACK);
- //printf("%u\n", *p);
- p+=3;
- }
- }
- }
- }
- int main()
- {
- int i;
- i = f_asm( );
- SystemCoreClockUpdate();
- GPIOInit();
- init_timer32(0, 10);
- UARTInit(115200);
- UARTSendString((uint8_t*)"OLED - Peripherals\r\n");
- SSPInit();
- oled_init();
- joystick_init();
- while(1){
- updateOLED(joystick_read());
- }
- // return test_bin_symbol[0];
- //light_enable();
- //light_setRange(LIGHT_RANGE_4000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement