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
/** | |
* @author Mike Almond - @mikedotalmond | |
* | |
* Example sketch for working with the HC-SR04 Ultrasound distance sensor | |
* http://users.ece.utexas.edu/~valvano/Datasheets/HCSR04b.pdf | |
* | |
* Uses a hardware interrupt to monitor the echo pin and measure the pulse length (without pausing code execution like you would when using Arduino::pulseIn()) | |
* https://github.com/mikedotalmond/arduino-pulseInWithoutDelay | |
* PulseInZero uses interrupt 0 ( pin 2 on arduino uno) | |
* PulseInOne uses interrupt 1 ( pin 3 on an arduino uno) |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
/* run this program using the console pauser or add your own getch, system("pause") or input loop */ | |
int suma(int); | |
int mult(int); | |
void genera(int, int, int); | |
int x,y,z,a,li,ls; | |
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
from microbit import spi, sleep, pin16 | |
import array | |
import gc | |
class LoRa(object): | |
""" | |
Radio - LoRa. Single channel. | |
""" | |
def __init__(self, Frequency=434.450, Mode=1): |
On low memory devices like the arduino and esp8266 you do not want strings to be stored in RAM. This occurs by default on these systems. Declare a string const char * xyz = "this is a string"
and it will use up RAM.
The solution on these devices is to allow strings to be stored in read only memory, in Arduino this is the PROGMEM macro. Most of my experience is with the ESP8266 which is a 32bit micros controller. This device stores PROGMEM data in flash. The macro PROGMEM on ESP8266 is simply
#define PROGMEM ICACHE_RODATA_ATTR
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
// Copyright 2017-2018 Pavitra, All rights reserved | |
// Released under the Apache License, Version 2.0 | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
package com.pavitra; | |
import android.content.Context; | |
import android.util.Log; | |
import com.physicaloid.lib.*; |
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
// Requires ws and screenshot-desktop | |
const WebSocket = require('ws'); | |
const screenshot = require('screenshot-desktop') | |
const wss = new WebSocket.Server({ port: 8889 }); | |
wss.on('connection', function connection(ws) { | |
ws.on('message', function incoming(message) { | |
console.log('received: %s', message); |
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
Latest versions of these scripts are available in git repository https://github.com/jcmvbkbc/esp32-linux-build |