Skip to content

Instantly share code, notes, and snippets.

View cmaglie's full-sized avatar

Cristian Maglie cmaglie

View GitHub Profile
@cmaglie
cmaglie / StringStream.h
Last active February 18, 2023 14:27
StringStream class for Arduino
#ifndef _STRING_STREAM_H_INCLUDED_
#define _STRING_STREAM_H_INCLUDED_
#include <Stream.h>
class StringStream : public Stream
{
public:
StringStream(const String &s) : string(s), position(0) { }
/* Copyright (c) 2011, Peter Barrett
**
** Permission to use, copy, modify, and/or distribute this software for
** any purpose with or without fee is hereby granted, provided that the
** above copyright notice and this permission notice appear in all copies.
**
** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
@cmaglie
cmaglie / PKeyboard.cpp
Last active August 29, 2015 13:56
Pluggable modules draft
#include "PKeyboard.h"
PKeyboardClass::PKeyboardClass() {
add("Keyboard");
}
void PKeyboardClass::begin() {
}
PKeyboardClass PKeyboard;
@cmaglie
cmaglie / SPITest.ino
Last active August 29, 2015 14:00
SPITest
#include <SPI.h>
void setup() {
SPI.begin();
Serial.begin(9600);
SPI.setClockDivider(SPI_CLOCK_DIV2);
while (!Serial)
;
delay(5000);
package main
import "fmt"
import "os/exec"
import "log"
import "strings"
import "sync"
type TaskData struct {
board string
@cmaglie
cmaglie / package_index.json.diff
Created January 28, 2016 17:46
updates to package_index.json to support ARM build
--- package_index.json 2015-12-28 16:48:07.000000000 +0100
+++ test_package_arm_index.json 2016-01-28 17:54:04.000000000 +0100
@@ -620,6 +620,13 @@
"version": "4.8.3-2014q1",
"systems": [
{
+ "host": "arm-linux-gnueabihf",
+ "url": "http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz",
+ "archiveFileName": "gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz",
+ "checksum": "SHA-256:d23f6626148396d6ec42a5b4d928955a703e0757829195fa71a939e5b86eecf6",
// This sketch should fix a "bricked" Arduino Zero board due to a bug in "Burn bootloader" command.
// For more information see: https://github.com/arduino/ArduinoCore-samd/issues/137
// **IMPORTANT**: After running the sketch, you must power cycle the board.
// This code is freely inspired from Atmel Application Note:
// http://atmel.force.com/support/articles/en_US/FAQ/SAMD20-SAMD21-Programming-the-fuses-from-application-code
void setup() {
Serial.begin(115200);
--- libindexold 2016-06-22 16:51:19.977475255 +0200
+++ /home/megabug/library_index.json 2016-06-22 16:51:13.100894318 +0200
@@ -8981,7 +8981,7 @@
"checksum": "SHA-256:c78354e55cddf0464eaf92539848ab53e526d5c78f2773dc5b2359bdd793b434"
},
{
- "name": "Micro OLED Breakout",
+ "name": "SparkFun Micro OLED Breakout",
"version": "1.0.0",
"author": "SparkFun Electronics",
{
"packages": [
{
"name": "test",
"maintainer": "Test",
"websiteURL": "http://www.arduino.cc/",
"email": "[email protected]",
"help": {
"online": "http://www.arduino.cc/en/Reference/HomePage"
},
@cmaglie
cmaglie / dependency_test.go
Created April 21, 2022 08:27
golang imports ACL test
// This file is part of arduino-cli.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-cli.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
// You can be released from the requirements of the above licenses by purchasing