Howto: open source

While I’ve been studying about open source projects, I found this very interesting reference about creating and maintaining an open source initiative: Producing Open Source Software by Karl Fogel. The book is available at: http://producingoss.com/

Karl compiles a list of resources and learnings about how to run an OSS project: techinical issues, communication, political and social environment, etc.

 

 

 

Arduino Yún

Hardware Description

https://www.arduino.cc/en/Main/ArduinoBoardYun

Getting Started Guide

https://www.arduino.cc/en/Guide/ArduinoYun

Some Inspiring Projects

https://create.arduino.cc/projecthub/products/arduino-yun

hackaday

Related Libraries

https://www.arduino.cc/en/Reference/YunBridgeLibrary

http://www.arduino.org/learning/reference/ciao-library

Defensive Programming

Design by contract

A compromise of the functionalities and behavior of a module;

Use assert()

pros:

  • improve testing
  • detect bugs
  • behaves like executable comments
  • improve code quality
  • can be turned on and off

cons:

  • slowdown execution
  • commonly misunderstood
  • some times used improperly for error handling

 

Static Code Analysis

Excelent tool for detecting errors that the compiler won’t detect.

Other techniques

Data hiding (encapsulation)

exposes only necessary functions;

Robust watchdogs

  • should have separated clock sources;
  • fast detection of failures
  • ability to accuse what went wrong

Stack monitor

easily implemented in RTOS, but hard to implement in baremetal;

Error handling

 

References

Benigno Defensive Programming

my debian tweaks

First steps:

Comment the CDROM option in the apt source list at  /etc/apt/sources.list

# deb cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 DVD Binary-1 20170116-11:01]/ jessie contrib main

some basic tools

apt-get install vim git tree 

…if it’s a virtualbox VM

apt-get install virtualbox-guest-utils

I made another post about virtualbox

dev tools

apt-get install kicad arduino

pending: cross compiling tools for arm

user conf tools

https://github.com/antonioluppi/userconfig

Virtualbox tweaks

Usually Virtualbox VM’s doesn’t adjust themselfes. So here’s some tweeks if you want to use Virtualbox:

Adjusting the monitor resolution

VBoxManage.exe setextradata "VM NAME" CustomVideoMode1 1920x1200x32

https://superuser.com/questions/495670/make-virtualbox-use-full-screen-size-in-windows-8

sudo apt-get install virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms

https://askubuntu.com/questions/3205/higher-screen-resolution-in-virtualbox

An awesome guide in LED driver circuits

LEDs have a constant voltage drop while conducting, and in order to operate effectively, they need to be supplied with a constant current source. If the current is to high, the component would burn; If it’s too low, it would be unnecessarily dimmed.

The problem with the serial resistor and alternatives

The simplest way of making a current source is using a resistor as current limiter. The problem in this set-up is that you must have information of the voltage drop of the LED, and sometimes it’s not so accurate. Also, using different power supplies and stacking LEDs require different resistances and power specs.

…But how?

  • discrete with transistors;
  • linear regulator;
  • switching regulator and specialized circuits.

Discrete current sourcesource

In this circuit, Q2 is the power transistor that controls the current, and R2 +Q1 are the feedback loop that controls Q2.

  • R1 100KΩ (1/4 W) resistor;
  • Q1 small transistor;
  • Q2 large transistor;
  • R2 large resistor.
    • R2 = V_base / I_diode
    • P_R2 = V_base² / I_diode

Linear regulators

pros: fewer parts; inexpensive

cons: low efficiency in low voltages (depends on the regulator dropout voltage)

lm317_constantcurrent

from the TI LM317 datasheet [2]

Switching regulators and specialized circuits

The most expensive, but the best in efficiency and flexibility. A good product example is this mini buckpuck.

References

[1] Dan Goldwater’s (awesome) guide on LED drives

[2] TI LM317 Datasheet

[3] mini buckpuck