Skip to content

Instantly share code, notes, and snippets.

View dvdvideo1234's full-sized avatar
🤑
Baking rakia !

Deyan Dobromirov dvdvideo1234

🤑
Baking rakia !
View GitHub Profile

A metatable can be defined like

local t = setmetatable({}, {
  __tostring = function() return 'custom tostring behavior!' end
})

Here are the metamethods that you can define, and their behavior

Operators

/******************************************************************************
* MSP430 ADC10 Example for the G2231
*
* Description: This code provides an example for using the 10 bit ADC in the
* MSP430G2231. The code requires either a terminal program or
* the application provided on the blog mentioned below.
* depending on which ascii character is sent to the device,
* either VCC, the temperature sensor, or an external pin will
* be measured once and the results sent to the computer.
*
@dvdvideo1234
dvdvideo1234 / FanController.c
Last active September 12, 2015 06:32 — forked from PhirePhly/FanController.c
A simple Integral fan controller driving three PC fans.
#include "msp430G2452.h"
#define FAN_CNT (3)
#define PWM_FREQ (32)
#define PWM_RESS (128)
// Port 1
#define LED1 (1<<0)
#define TMP_RX (1<<1)
static const int TACH[] = { (1<<3), (1<<4), (1<<5) };