Skip to content

Instantly share code, notes, and snippets.

@apla
apla / DA14580.agent.nut
Last active August 29, 2015 14:27 — forked from blindman2k/DA14580.agent.nut
Dialog DA14580 programmer. Upload a HEX file and it programs the DA14580.
server.log("Agent started, URL is " + http.agenturl());
//------------------------------------------------------------------------------------------------------------------------------
program <- null;
html <- @"<HTML>
<BODY>
<form method='POST' enctype='multipart/form-data'>
@apla
apla / form-fields.js
Created July 25, 2015 08:39
form fields manipulation
function setFormFields (formEl, fieldsData) {
for (var i = 0; i < formEl.elements.length; i ++) {
var formField = formEl.elements[i];
if (!(formField.name in fieldsData)) {
continue;
}
// TODO: multiple checkboxes value for one form field
if (formField.type === 'radio' || formField.type === 'checkbox') {
if (

NOTE: this example require platform API with promise support (Promise, WinJS.Promise or $.defered)

  1. Open Inspector
  2. Paste test-app-preferences.js into Console
  3. Run fetchIncrementStore ("test-run-count") from Console

Value must increment regardless application restart

@apla
apla / main_ADC.c
Last active August 29, 2015 14:15 — forked from nicholasjconn/main_ADC.c
/******************************************************************************
* 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.
*
@apla
apla / platform.txt
Created February 13, 2015 16:53
stellaris launchpads for cuwire and Arduino IDE 1.6.0
# from: https://groups.google.com/a/arduino.cc/forum/#!topic/developers/ZwxNPJHccQI
# LM4F test.
# ------------------------------
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Stellaris Launchpads
version=1.6.0
@apla
apla / cli.js
Created February 6, 2015 09:54
#!/usr/bin/env node
var ArduinoData = require ('cuwire/data');
var ArduinoCompiler = require ('cuwire/compiler');
var ArduinoUploader = require ('cuwire/uploader');
var CuwireSerial = require ('cuwire/serial');
var argv = require ('yargs').argv;
var fs = require ('fs');
@apla
apla / cuwire.json
Last active August 29, 2015 14:14
my cuwire preferences
{
"arduino": "/Applications/devel/Arduino.app",
"sketch": {
"vccavr": {
"folder": "/Users/apla/work/mcu/brackets-cuwire/samples/ArduinoVoltage",
"platform": "arduino:avr",
"board": "pro",
"model": {
"cpu": "16MHzatmega328"
},
@apla
apla / Arduino.h
Last active August 29, 2015 14:13
arduino project static analyze using node-libclang
/*
Arduino.h - Main include file for the Arduino SDK
Copyright (c) 2005-2013 Arduino Team. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
@apla
apla / boards.txt
Last active August 29, 2015 14:12
msp430 arduino 1.5 support
# See: http://code.google.com/p/arduino/wiki/Platforms
menu.cpu=Processor
##############################################################
wizzi.name=wizzimote w/ cc430f5137
wizzi.build.core=wizzimote
wizzi.upload.tool=tilib_wizzi
wizzi.upload.protocol=tilib_wizzi
wizzi.upload.maximum_size=31104
@apla
apla / .dataflows|example.json
Created May 27, 2014 08:47
dataflows example
[{
"path": "post",
"tasks": [{}]
}, {
"path": "upload"
}, {
"path": "presenters",
"flows": [{
"path": "json",
"data": {