Home
Wednesday, 29 May 2013 18:41

Digispark Infrared Receiver

Digispark Infrared Receiver
Digispark is an Attiny85 based microcontroller development board similar to the Arduino line which is smaller and cheaper. Now you can connect an infrared detector to the Digispark and turn it to an infrared controller to control your devices.
 
Digispark is copyrighted by Digistump LLC (digistump.com) and the full license is here
 
Published in Blog
Friday, 24 May 2013 21:09

Arduino PCB DIY

Arduino PCB
If your projects require many Arduino and you do not want to purchase the expensive full set of Arduino, here is the good place to go.
All the PCB design is single sided I sugggested to use toner transfer to make the PCB. You should Google "toner transfer" if you want to know more about it.
 
I should mention all the collection of PCB is not my own design, all credit goes to each respective authors.
Published in Blog
Wednesday, 22 May 2013 22:03

Digispark DIY: The smallest USB Arduino

Digispark
Digispark is an ATtiny85 based microcontroller development board come with USB interface. Digispark is very small and inexpensive but less powerful than Arduino. Coding is similar to Arduino, and it use the familiar Arduino IDE for development.
 
Digispark is copyrighted by Digistump LLC (digistump.com) and the full license is here
 
Here is an article on how to making a Digispark, however if you want to purchase a finished product, you can always get it from  Digispark's author homepage.

Published in Blog
Monday, 20 May 2013 21:01

自制Digispark: 最小USB Arduino

Digispark
Digispark是一个基于ATTINY85微控制器的开发板,体积小且价钱便宜,功能方面则没有Arduino般强大。代码与Arduino大同小異,也是使用Arduino IDE开发。
 
Digispark是Digistump LLC (digistump.com)版权所有,请使用者仔细阅读Digispark使用协议和版权声明
 
Digispark的特别之处是使用了USB与电脑沟通,省了USB至串口转换器。为此,Digispark必须占用2KB的快闪记忆体(Flash Memory)以便用来安装Bootloader。
Published in 电子与电脑
Saturday, 27 April 2013 08:10

Arduino与I2C/TWI LCD1602模块

I2C LCD1602 Module
I2C/TWI LCD1602是由DFRobot生产的LCD模块。LCD1602模块应用了I2C接口(只用两条信号线),适用于引脚有限的微控制器。从上图看得出,LCD後方安装有一个可变电阻器,用来调整光线对比(contrast)。

LCD1602规则说明
  • 接口:I2C
  • I2C地址:0X27
  • 电源电压:5V
  • 重量:40克
Published in 电子与电脑
Tuesday, 23 April 2013 12:17

Password access with Arduino using keypad

Arduino and Keypad
This example demonstrates how to use a 4x4 matrix keypad access password from an Arduino. Sketch below required to install password and keypad library, both available at Arduino Playground. Below list the functions of password library:

set(password)
Set the target password equal to password.

is(password)
Is the target password equal to password

append(character)
Append a character to the currently guessed password

reset()
Reset the currently guessed password

evaluate()
Is the guessed password equal to the target password?

Published in Tutorials
This demonstration (writing string to EEPROM) adopted the code from Arduino Playground and I  had removed some of the features to make it simple and easy to understand.
 
 
Code below demonstrate how to write strings to EEPROM at specified location(address) and then read it back.
Published in Tutorials
Thursday, 18 April 2013 22:26

读取和写入任何结构EEPROM

Arduino内建的EEPROM函数(function)毎次只支能写入一个字节(one byte),一个英文字母或者整数从0到255。当想要写入较大的数字时,唯有调用多次的EEPROM函数,从而造成代码复杂以及难于调试。
 
使用下面的代码,只需一次EEPROM函数调用,任何数据结构或变数都可以一一写入及读取。保存以下代码至文件名为EEPROMAnything.h

#include <EEPROM.h>
#include <Arduino.h> // for type definitions

template <class T> int EEPROM_writeAnything(int ee, const T& value)
{
   const byte* p = (const byte*)(const void*)&value;
   unsigned int i;
   for (i = 0; i < sizeof(value); i++)
   EEPROM.write(ee++, *p++);
   return i;
}

template <class T> int EEPROM_readAnything(int ee, T& value)
{
   byte* p = (byte*)(void*)&value;
   unsigned int i;
   for (i = 0; i < sizeof(value); i++)
   *p++ = EEPROM.read(ee++);
   return i;
}

 

 

一旦有了以上文件,编写程序前只要添加#include "EEPROMAnything.h"就能调用 EEPROM_writeAnything 和 EEPROM_readAnything函数了。请看以下例子:
#include <EEPROM.h>
#include "EEPROMAnything.h"
struct config_t
{
    long alarm;
    int mode;
} configuration;
void setup()
{
    EEPROM_readAnything(0, configuration);
    // ...
}
void loop()
{
    // let the user adjust their alarm settings
    // let the user adjust their mode settings
    // ...
    // if they push the "Save" button, save their configuration
    if (digitalRead(13) == HIGH)
        EEPROM_writeAnything(0, configuration);
}
  
当然也可以使用avr的eeprom程序库来代替以上EEPROMAnything.h

#include <avr/eeprom.h>

struct settings_t
{
  long alarm;
  int mode;
} settings;

void setup()
{
  eeprom_read_block((void*)&settings, (void*)0, sizeof(settings));
    // ...
}
void loop()
{
    // let the user adjust their alarm settings
    // let the user adjust their mode settings
    // ...

    // if they push the "Save" button, save their configuration
    if (digitalRead(13) == HIGH)
      eeprom_write_block((const void*)&settings, (void*)0, sizeof(settings));
}

Published in Tutorials
Tuesday, 16 April 2013 21:05

Arduino and Stronglink SL018 RFID module

Stronglink SL018 RFID module
Among the RFID modules, Stronglink SL018 is the lowest cost RFID module that I can get which supports read and write. SL018 is a 13.56MHz RFID module, it supports Mifare 1K, Mifare 4K and Mifare Ultralight. The specification are as follow:
Model
MIFARE Module SL018
Frequency
13.56MHz
Protocol
ISO14443A
Tag supported
Ultralight, NTAG203, MIFARE Mini, MIFARE ™ Classic 1K, 4K MIFARE Classic ™, FM11RF08
Interface
I2C
Supply voltage
4.4 - 7.0VDC
Dimension
65 × 45 mm

To communicate with Arduino, Marc Boon had developed the SL018 library for Arduino which support reading UID of tags and reading/writing tags.
Published in Blog
Sunday, 14 April 2013 21:10

Arduino读取键盘

Arduino and Keypad
这里提供两种方式从Arduino读取键盘。第一种方式是使用矩阵式(Matrix)键盘,另一种方式是使用PS2键盘。
 
矩阵键盘(Matrix keypad)
首先必须安装Arduino Keypad键盘库(Keypad library),Arduino Keypad键盘库可以从Arduino Playground下载。Arduino Keypad键盘库让你读取矩阵式键盘而不用编写复杂的代码,此键盘库可以读取3x4, 4x4以及各种矩阵结构的键盘。
Published in 电子与电脑
Page 4 of 6