Skip to content

Instantly share code, notes, and snippets.

View AndrewFromMelbourne's full-sized avatar

Andrew Duncan AndrewFromMelbourne

View GitHub Profile
@AndrewFromMelbourne
AndrewFromMelbourne / fltk_image.cxx
Created October 5, 2022 07:54
Simple FLTK Image example
#include <FL/Fl.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Window.H>
#include <cstdint>
#include <cstdlib>
class An_Image_Window
:
public Fl_Window
#include <stdio.h>
#include <jpeglib.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/fl_ask.H>
#include <FL/fl_draw.H>
#include <FL/fl_file_chooser.H>
using namespace std;
@AndrewFromMelbourne
AndrewFromMelbourne / wifiscan.cxx
Last active December 20, 2022 02:41
wifi scanning code
// sudo apt-get install libiw-dev
//
// g++ -O3 -Wall wifiscan.cxx -o wifiscan -liw
#include <iwlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "bcm_host.h"
void
takeSnapshot(
#include <stdio.h>
#include <bcm_host.h>
#define SRC_WIDTH 640
#define SRC_HEIGHT 480
#define DST_WIDTH 1920
#define DST_HEIGHT 1080
int main()
{
bcm_host_init();
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "bcm_host.h"
void
takeSnapshot(
@AndrewFromMelbourne
AndrewFromMelbourne / dispmanx.c
Created January 9, 2014 23:21
Modified version of hello_dispmanx showing issue DispmanX elements that have negative y offsets.
/*
* Copyright (c) 2012 Broadcom Europe Ltd
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
#include <LiquidCrystal.h>
#include <Wire.h>
//-------------------------------------------------------------------------
enum
{
LCD_CLEAR = 0x01,
LCD_HOME = 0x02,
LCD_NO_DISPLAY = 0x03,