@theliuyan just posted a few pictures from the Sunday’s Cub Scout event. It was fun to introduce some hardware hacking to cub scouts. I think they enjoyed it with their great group of supportive parents. Just put Tiger Mom on the title for SEO. 😉 The activity is part of their scout engineering and we were making Electronics Dice.
Electronic Dice
February 27th, 2011 § 0 comments § permalink
Got a chance to introduce Arduino to the boy scout at YCIS. It was a fun afternoon working with the boys and the parents. Here are more on the design of the electronic dice. Look forward to seeing the boys completing the system next week.
The tool used to design the dice is Fritzing. It’s an open source design program for interactive electronics. The functionalities of the dice is pretty straight forward: when the button is press, the LEDs start to flash and on the release of the button, one of the LED is randomly picked.
Arduino is used to drive the dice logics. Arduino is a popular open source microcontroller for building interactive electronics. It comes with an easy-to-use IDE that can be downloaded here.
The complete program of the dice is here. Just connect up the Arduino board to the computer using the USB cable and launch the IDE to upload the program. Would be fun to see some tinkering with the program to provide different behavior of the dice.
#define RANDOM 1
#define PICKED 2
#define BOUNCEDELAY 50
int state;
void setup()
{
pinMode(7, INPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
state = 1;
Serial.begin(9600);
}
int reading = 0;
int button = 0;
int last_button = 0;
int picked = 0;
void loop()
{
if (state == RANDOM) {
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
delay(50);
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
delay(50);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
delay(50);
} else if (state == PICKED) {
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(picked, HIGH);
}
reading = digitalRead(7);
if (reading == last_button) {
button = reading;
} else {
last_button = reading;
}
if (button == 1) {
state = RANDOM;
} else {
state = PICKED;
if (button != last_button) {
picked = random(3) + 2;
}
}
}
]]>
Design a Block Language for Arduino
February 7th, 2011 § 1 comment § permalink
I have been playing around with OpenBlocks. It’s a very flexible environment to create a new block language. When it comes to design one for Arduino, I found myself wondering between two different styles of design.
Design I
The first design is of course to follow the Arduino Language Reference closely. However, the resulting block language seems to be a bit too “verbose?” Or should I say “busy” since it’s really a graphical representation of the textual program. Here is a sample of what it looks like for the equivalence of codes here.
void setup() { pinMode(1, INPUT); pinMode(2, OUTPUT); } void loop() { if (digitalRead(1) == HIGH) { digitalWrite(2, LOW); } }
Design II
Since the block language is targeted at the beginner of Arduino and programming, most of time, we talk about “When the button on pin 1 is pushed, I want the LED on pin 2 to light up.” There is a much natural way to map this statement into an intuitive block language by building the blocks around the pin. Here is how it may look like:
This language is more concise and easier to understand. The language itself should provide enough meta info to infer the setup codes. However, in order to do this, the language may need a little runtime (OS?) to be compiled along with the Sketch but it seems to be worth the effort.
The OpenBlocks codes I am playing around with the idea is available at my ‘ant’ branch openblocks on github. Appreciate any feedback on this.
]]>Visual Programming Language for Arduino (1)
February 5th, 2011 § 0 comments § permalink
To make Arduino easier for non-programmers, I decided to start a visual programming environment similar to Scratch for Arduino.
Similar Projects around the Web
Modkit is a similar project but at the time I wanted to start the project, it was in a closed alpha. Also, it seems that modkit is going to be proprietary and I want an open source VPL for Arduino. By the way, Modkit CrimpCards is an awesome idea and design.
S4A (Scratch for Arduino) is another interesting project but it’s for using Scratch with Arduino instead of programming for Arduino.
David Mellis over at MIT Media Lab also has a project called “Scratch for Arduino” but no detail yet. David is also one of the creator of Arduino platform.
Arduino IDE and OpenBlocks
Fork the source of Arduino IDE hosted on github to host my version here. Next stop is to find a library for the visual programming. I found a project called OpenBlocks developed as part of the MIT StarLogo NG. Open Blocks is also used in Google’s Android development tool App Inventor.
Both Arduino IDE and Open Blocks are written in Java so the integration should be smooth. Since I have done by share of Java, I decided to also use this opportunities to look into a few alternative languages running on JVM to implement this. Since I have done mostly Ruby for the past few years, JRuby looks pretty good. The language I really want to use is Clojure but it seems it’s a bit tricky to use it embedded in a Java app. Will give both a try and see how it goes.
Let the hacking beging!
Hopefully, we will have a running version in the next few weeks. ]]>Arduino compatible electronic blocks for Lego from Flamingo EDA
January 26th, 2011 § 0 comments § permalink
Flamingo EDA brought to the Xinshanzhai talk is the Lego compatible sensor block! This is very awesome. I WANT ONE! Actually, I want a DOZENS and a bucket of Lego blocks! ]]>
Chaotic Robo Event
January 17th, 2011 § 0 comments § permalink
Xindanwei end to end. Ricky kicks off the event with A.R.T. and gave a short introduction to how he got started with the project and how ART was built. Then we have the introduction to the HCR robots by the presenter also named Ricky. HCR is an open source robot built to for home caring. And some random photos from the events. ]]>
Robotic class @ Xin Che JIan – 机器人课程 @ 新车间
January 17th, 2011 § 0 comments § permalink
新车间的机器人课程是针对对物理运算有兴趣了解的朋友提供入门的课程和实践机会,适合十岁以上的人参加。 课程内容为: 8小时的授课时间:
- Arduino入门
- 电子和物理计算硬件概念
- 编程语言处理
- 物理计算: 软件與硬件的互动
- 机器人入门
- 什么是机器人?
- 如何用遥控车和Arduino來做机器人
- 自主玩具机器人 (A.R.T.) 入门
- 实验室共有2〜3个教师提供援助
- 动手做自主机器车
- Introduction to Arduino
- Hardware Concept of Electronics and Physical Computing
- Processing programming language
- Physical Computing: Interface Digital and Physical world
- Introduction to Robotics
- What’s robot?
- Robotics using RC car and Arduino
- Introduction to A.R.T.
- 2 ~ 3 teachers in labs offering assistance
- make your own autonomous robot car
ARTv5 Electronics Design
January 15th, 2011 § 0 comments § permalink
ARTv4 to have interesting, pseudo-intelligent behaviors (and not running out of SRAM which causes it to reset randomly…), I’m also working on the next generation electrical design for ART… I’m naming the bundle of software and electronics ARTv5. The plan is to support more infrared and ultrasonic sensors with an RF transceiver for sending telemetry information. I also want to start producing and using PCB boards to get away from the fragile breadboards. More specifically, these PCB will take the form of Arduino-shields that I can stack on top of each other. The plan right now is to create three boards that are stackable:
- One for the ultrasonics sensors (front, rear, left, right);
- One for the infrared sensors (front, rear, left, right);
- One with four connectors to ultrasonics sensors, infrared sensors, motors control in addition to the connector for the RF transceiver.
- Ultrasonics sensors shield: 10 wires (1 VCC, 1 GND, 4 echos, 4 triggers);
- Infrared sensors shield: 6 wires (1 VCC, 1 GND, 4 signals);
- RF transceiver: plugs into two 9×2 headers (1 VCC, 1 GND and the SPI wires);
- Four control motor wires for the H-bridge (used right now to connect directly to the RF transmitter as a hack).
- 1xGeneric female header – 10 pins;
- 1xGeneric female header – 2 pins;
- 2xGeneric female header – 4 pins;
- 1xGeneric female header – 6 pins.
IDEO模式: 山寨设计是创新的开放平台 Shanzhai Design as an Open Platform for Business Innovation – Pattern from IDEO
January 12th, 2011 § 1 comment § permalink
IDEO模式: 山寨设计是创新的开放平台 时间: 2011年元月二十二日,下午两点到五点 地点:徐汇区永嘉路50号新单位(近陕西南路) 费用: 30元/人 山寨是一个为草根创意阶级提供的开放式创新平台: 复制苹果, 诺基亚, 三星智能手机, 这些仿冒品由原产品改装而成同时加入了更吸引于中国消费者的设计. 山寨设计师为电子产品注入闪光点和关键元素. 其目的正是为了使产品在价格, 外观, 价值和用户需求上能接近普通消费人群. 山寨设计为国际公司向中国本土消费者介绍他们的品牌提供了一个机会, 他们也能借机观察中国本土文化如何作用于他们的产品, 如何相互磨合与适应. 这些公司怎样通过观察山寨设计来学习? IDEO 将分享他们对于这一重大领域的观点和方法学. 2:00pm 开放: 新单位CEO 刘妍介绍活动内容,演讲者, 来宾, 目标阐述 2:15pm 1. 山寨设计作为一种商业创新的开放平台- IDEO (15分钟) 2. 怎样山寨? -快速原型-IDEO-30分钟 -原型的工具 -Arduino – Flamingo EDA -20分钟 – Android –20分钟 -从原型到制作 – C2Tech –20分钟 4:30pm Android原型板以及工具的使用说明 参访新车间, 相互认识新朋友. Shanzhai Design as an Open Platform for Business Innovation – Pattern from IDEO Time: 14:00 – 17:00, Jan 22, 2011 Location: Xindanwei, 50 Yongjia Rd Cost: 30yuan/person Shanzhai is an open platform for grassroots innovation. Apple, Nokia, and Samsung smartphones get copied, but the knockoffs adapt the original designs in ways that appeal to Chinese customers. Shanzhai designers might add a flashlight, key in areas with unstable electricity. The effect is to make products accessible to common folks in terms of price, aesthetics, values, and needs. Shanzhai designs are an opportunity for international companies to introduce Chinese consumers to their brands, and then observe how local Chinese culture adapts their offerings. How might companies harness learning by observing Shanzhai designs? IDEO will share their perspectives and methodologies on these big questions for business. 2:00pm Opening: Introduce the event, speakers, guests and talk about the goals, by Liu Yan(xindanwei) 2:15pm 1.IDEO: “Shanzhai as an open platform for innovation” – 15 minutes 2.How to Shanzhai? – “Rapid prototyping” – IDEO – 30 minutes – Tool of prototyping – Arduino – Flamingo EDA – 20 minutes – Android – – 20 minutes -From prototype to production – C2Tech – 20 minutes 4:00pm Part Two: Android prototype boards and tools demonstration Followed by a visit to Xinchejian and networking ]]>