Skip to content

Instantly share code, notes, and snippets.

View desireesantos's full-sized avatar

Desiree Santos desireesantos

View GitHub Profile
@desireesantos
desireesantos / gist:e22d09dc91140acd4b901050b8d507a7
Created March 12, 2018 00:30
WatchDog solution to reset arduino every 4 seconds
#include <avr/wdt.h>
void setup() {
//Reset arduino every 4 seconds WDTO_4S
//https://www.nongnu.org/avr-libc/user-manual/group__avr__watchdog.html#ga9e52c54d10b6a6a7ce04aaaa4abea51f
wdt_enable(WDTO_4S);
Serial.begin(9600);
}
void loop() {
@desireesantos
desireesantos / play_wave
Last active August 29, 2015 14:26
Executar arquivos .wav utilzando festival lite
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
/* Copyright (c) 2000 */
/* All Rights Reserved. */
/* */
/* Permission is hereby granted, free of charge, to use and distribute */
/* this software and its documentation without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
/* Copyright (c) 2000 */
/* All Rights Reserved. */
/* */
/* Permission is hereby granted, free of charge, to use and distribute */
/* this software and its documentation without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
@desireesantos
desireesantos / controller.js
Last active August 29, 2015 14:04
Módulo responsável por gerenciar socket
var ws = require('ws');
exports.create = function () {
machine = new Machine(name,status);
ws.callSocket(machine.status);
}
int direction= 3;
int step = 2;
int velocity = 5;
int number = 0;
char command;
#define FORWARD LOW
#define BACKWARD HIGH
void setup(){
@desireesantos
desireesantos / data.json
Created December 26, 2013 16:58
Long and Latitude on BR area.
[
{
"latitude": -19.212355602107472,
"longitude": -44.20234468749999
},
{
"latitude": -22.618827234831404,
"longitude": -42.57636812499999
},
{
@desireesantos
desireesantos / heatmap.js
Created December 26, 2013 16:57
Js file responsible to generate heatmap
var map,heatmap;
var taxiData = new Array();
var gradient = [
'rgba(0, 255, 255, 0)','rgba(0, 255, 255, 1)',
'rgba(0, 191, 255, 1)','rgba(0, 127, 255, 1)',
'rgba(0, 63, 255, 1)','rgba(0, 0, 255, 1)',
'rgba(0, 0, 223, 1)','rgba(0, 0, 191, 1)',
'rgba(0, 0, 159, 1)','rgba(0, 0, 127, 1)',
'rgba(63, 0, 91, 1)','rgba(127, 0, 63, 1)',
'rgba(191, 0, 31, 1)','rgba(255, 0, 0, 1)'
@desireesantos
desireesantos / index.html
Created December 26, 2013 16:55
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Heatmaps</title>
<link rel="stylesheet" type="text/css" href="/css/style.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=visualization"></script>
<script type="text/javascript" src="/js/heatmap.js"></script>
</head>
@desireesantos
desireesantos / Folders
Created December 14, 2013 22:27
Folder struct LevelUp project
-resources
-css
--style.css
-img
--icon.png
-js
--map.js
-template
--index.html
function initialize() {
geocoder = new google.maps.Geocoder();
alert(geocoder.latitude);
alert(geocoder.longitude);
var latlng = new google.maps.LatLng(-22.618827234831404, -42.57636812499999);
var mapOptions = {
zoom: 8,
center: latlng
}
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);