Skip to content

Instantly share code, notes, and snippets.

View bright-light-in-the-night's full-sized avatar
🏠
Working from home

Singing Dinosaur bright-light-in-the-night

🏠
Working from home
View GitHub Profile
2 - Autos & Vehicles
1 - Film & Animation
10 - Music
15 - Pets & Animals
17 - Sports
18 - Short Movies
19 - Travel & Events
20 - Gaming
21 - Videoblogging
22 - People & Blogs
#include "mbed.h"
// Tutorial at https://ee-programming-notepad.blogspot.com/2016/10/suppress-any-warning-in-mbed-compiler.html
// Readme: https://developer.arm.com/docs/dui0472/latest/compiler-specific-features/pragma-diag_suppress-tagtag
// Warning and error codes: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0496b/BABDJCCI.html
// Suppress "Warning: Integer conversion resulted in truncation in "main.cpp", Line: 15, Col: 16"
// 69 - Integer conversion resulted in truncation
#pragma diag_suppress 69
// https://ee-programming-notepad.blogspot.com/2016/10/c-array-of-pointers-to-objects.html
#include "mbed.h"
#include "ILI9340_Driver.h"
#define LCD_MOSI D11
#define LCD_MISO D12
#define LCD_SCK D13
#define LCD_DC D7
#define LCD1_RST D3
// https://ee-programming-notepad.blogspot.com/2016/10/c-array-of-pointers-to-objects.html
#include "mbed.h"
#include "ILI9340_Driver.h"
#define LCD_MOSI D11
#define LCD_MISO D12
#define LCD_SCK D13
#define LCD_CS D5
#define LCD_RST D3
#define LCD_DC D7
@bright-light-in-the-night
bright-light-in-the-night / color depth 24 bits to 16 bits.php
Last active October 3, 2016 08:15
Transform an 24 bits color depth image file into 16 bits color depth raw file and back again
<?php
// https://ee-programming-notepad.blogspot.com/2016/09/php-script-to-transform-24-bits-color.html
error_reporting(E_ALL);
ini_set('display_errors', 'On');
header('Content-type: text/html; charset=utf-8');
set_time_limit(0);
// DESCRIPTION:
// these functions will transform an 24 bits color depth image file into 16 bits color depth raw file and back again
// https://ee-programming-notepad.blogspot.com/2016/09/16-bits-rgb-color-representation.html
uint16_t color;
// white
color = 0b1111111111111111; // binary representation
color = 0xFFFF; // hexadecimal representation
color = 65535; // decimal representation
// black
color = 0b0000000000000000; // binary representation