This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source https://wiki.maemo.org/SimpleGL_example | |
/* Created by exoticorn ( http://talk.maemo.org/showthread.php?t=37356 ) | |
* edited and commented by André Bergner [endboss] | |
* | |
* libraries needed: libx11-dev, libgles2-dev | |
* | |
* compile with: g++ -lX11 -lEGL -lGLESv2 egl-example.cpp | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
https://cdn.sparkfun.com/datasheets/Wireless/WiFi/ESP32ThingV1.pdf - esp32 thing pinout | |
https://cdn.sparkfun.com/assets/learn_tutorials/5/0/7/esp32-thing-schematic.pdf | |
http://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/gpio.html - GPIO documentation | |
http://www.lucadentella.it/en/2016/12/22/esp32-4-flash-bootloader-e-freertos/ - RTOS explanation | |
*/ | |
void loop_task(void *pvParameter) { | |
#define PIN (1 << 5) | |
gpio_config_t io_conf; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <msp430.h> | |
#include <legacymsp430.h> | |
// https://github.com/wendlers/msp430-harduart/blob/master/src/uart.c | |
// https://github.com/ideasium/msp430-uart/blob/master/msp430-uart/uart.c | |
// http://www.geom.uiuc.edu/~huberty/math5337/groupe/digits.html | |
char *pi = "3.141592653589793238462643383279502884197169399375105820974944592307816406286"; | |
int pos = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using ccr0, ccr1 and timer overflow interrupts to generate a pwm signal on p1.0 and p1.6 | |
#include <msp430.h> | |
#define interrupt(x) void __attribute__((interrupt (x))) | |
interrupt(TIMER0_A0_VECTOR) tmr_ccr0 () { | |
// interrupt flag is automatically reset | |
// ccr0 | |
P1OUT &= ~(BIT0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <msp430.h> | |
#define interrupt(x) void __attribute__((interrupt (x))) | |
interrupt(PORT1_VECTOR) isr() { | |
P1OUT ^= BIT6 | BIT0; // toggle | |
P1IES ^= BIT3; // change edge | |
P1IFG = 0x00; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on | |
// xbmc api example http://userscripts.org/scripts/review/117046 | |
// node.js example code http://nodejs.org/api/http.html#http_http_request_options_callback | |
var http = require('http'); | |
var options = { | |
hostname: '192.168.1.100', | |
port: 80, | |
path: '/jsonrpc', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
." hello world" cr | |
: hello ." hello world" cr ; | |
: 3times hello hello hello ; | |
: ntimes ( n -- ) begin dup 0> while hello 1- repeat drop ; | |
: sum ( xi n -- sum ) 0 swap begin dup 0> while 1- -rot + swap repeat drop ; |