madrona-rad 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/Rakefile +38 -129
- data/VERSION +1 -0
- data/bin/{rad → madrona-rad} +0 -0
- data/lib/examples/blink_m_address_assignment.rb +84 -92
- data/lib/examples/blink_m_multi.rb +52 -61
- data/lib/plugins/blink_m.rb +0 -8
- data/lib/rad/antiquated_todo.txt +47 -0
- data/madrona-rad.gemspec +201 -0
- data/project_dev.rake +36 -0
- data/test/fixture.rb +51 -0
- metadata +42 -42
- data/scripts/txt2html +0 -67
- data/website/examples/assembler_test.rb.html +0 -73
- data/website/examples/gps_reader.rb.html +0 -39
- data/website/examples/hello_world.rb.html +0 -38
- data/website/examples/serial_motor.rb.html +0 -41
- data/website/index.html +0 -178
- data/website/index.txt +0 -64
- data/website/javascripts/rounded_corners_lite.inc.js +0 -285
- data/website/stylesheets/screen.css +0 -169
- data/website/template.rhtml +0 -48
data/scripts/txt2html
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'redcloth'
|
5
|
-
require 'syntax/convertors/html'
|
6
|
-
require 'erb'
|
7
|
-
require File.dirname(__FILE__) + '/../lib/rad/version.rb'
|
8
|
-
|
9
|
-
version = Rad::VERSION::STRING
|
10
|
-
download = 'http://rubyforge.org/projects/rad'
|
11
|
-
|
12
|
-
class Fixnum
|
13
|
-
def ordinal
|
14
|
-
# teens
|
15
|
-
return 'th' if (10..19).include?(self % 100)
|
16
|
-
# others
|
17
|
-
case self % 10
|
18
|
-
when 1: return 'st'
|
19
|
-
when 2: return 'nd'
|
20
|
-
when 3: return 'rd'
|
21
|
-
else return 'th'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
class Time
|
27
|
-
def pretty
|
28
|
-
return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def convert_syntax(syntax, source)
|
33
|
-
return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
|
34
|
-
end
|
35
|
-
|
36
|
-
if ARGV.length >= 1
|
37
|
-
src, template = ARGV
|
38
|
-
template ||= File.dirname(__FILE__) + '/../website/template.rhtml'
|
39
|
-
|
40
|
-
else
|
41
|
-
puts("Usage: #{File.split($0).last} source.txt [template.rhtml] > output.html")
|
42
|
-
exit!
|
43
|
-
end
|
44
|
-
|
45
|
-
template = ERB.new(File.open(template).read)
|
46
|
-
|
47
|
-
title = nil
|
48
|
-
body = nil
|
49
|
-
File.open(src) do |fsrc|
|
50
|
-
title_text = fsrc.readline
|
51
|
-
body_text = fsrc.read
|
52
|
-
syntax_items = []
|
53
|
-
body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</>!m){
|
54
|
-
ident = syntax_items.length
|
55
|
-
element, syntax, source = $1, $2, $3
|
56
|
-
syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>"
|
57
|
-
"syntax-temp-#{ident}"
|
58
|
-
}
|
59
|
-
title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip
|
60
|
-
body = RedCloth.new(body_text).to_html
|
61
|
-
body.gsub!(%r!(?:<pre><code>)?syntax-temp-(d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] }
|
62
|
-
end
|
63
|
-
stat = File.stat(src)
|
64
|
-
created = stat.ctime
|
65
|
-
modified = stat.mtime
|
66
|
-
|
67
|
-
$stdout << template.result(binding)
|
@@ -1,73 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>assembler_test.rb.html</title
|
4
|
-
<style type="text/css">
|
5
|
-
|
6
|
-
.ruby .normal {}
|
7
|
-
.ruby .comment { color: #888; font-style: italic; }
|
8
|
-
.ruby .keyword { color: #A00; font-weight: bold; }
|
9
|
-
.ruby .method { color: #077; }
|
10
|
-
.ruby .class { color: #074; }
|
11
|
-
.ruby .module { color: #050; }
|
12
|
-
.ruby .punct { color: #447; font-weight: bold; }
|
13
|
-
.ruby .symbol { color: #099; }
|
14
|
-
.ruby .string { color: #944; }
|
15
|
-
.ruby .char { color: #F07; }
|
16
|
-
.ruby .ident { color: #004; }
|
17
|
-
.ruby .constant { color: #07F; }
|
18
|
-
.ruby .regex { color: #B66; }
|
19
|
-
.ruby .number { color: #D55; }
|
20
|
-
.ruby .attribute { color: #377; }
|
21
|
-
.ruby .global { color: #3B7; }
|
22
|
-
.ruby .expr { color: #227; }
|
23
|
-
</style>
|
24
|
-
</head>
|
25
|
-
<body>
|
26
|
-
<pre class="ruby">
|
27
|
-
<pre><span class="comment"># Hardware: Connect to serial output with screen:</span>
|
28
|
-
<span class="comment"># $ screen /dev/tty/path.to.your.usb 9600</span>
|
29
|
-
|
30
|
-
<span class="keyword">class </span><span class="class">AssemblerTest</span> <span class="punct"><</span> <span class="constant">ArduinoSketch</span>
|
31
|
-
<span class="ident">vars</span> <span class="symbol">:a</span> <span class="punct">=></span> <span class="number">10</span><span class="punct">,</span> <span class="symbol">:b</span> <span class="punct">=></span> <span class="number">4</span>
|
32
|
-
<span class="ident">serial_begin</span>
|
33
|
-
|
34
|
-
<span class="keyword">def </span><span class="method">loop</span>
|
35
|
-
<span class="ident">serial_println</span> <span class="ident">product</span><span class="punct">(</span><span class="ident">a</span><span class="punct">,</span><span class="ident">b</span><span class="punct">)</span>
|
36
|
-
<span class="keyword">end</span>
|
37
|
-
|
38
|
-
<span class="ident">assembler</span><span class="punct">(</span> <span class="symbol">:product</span><span class="punct">,</span> <span class="punct">"</span><span class="string">int product(int a, int b);</span><span class="punct">",</span>
|
39
|
-
<span class="punct"><<-</span><span class="constant">CODE</span><span class="string">
|
40
|
-
product:
|
41
|
-
mov r18,r24 ; move a to another register
|
42
|
-
ldi r24,0 ; clear running sum, used to coalesce product
|
43
|
-
ldi r25,0 ; sum = 0
|
44
|
-
|
45
|
-
.loop:
|
46
|
-
tst r18 ; is a = 0? if so, we're done
|
47
|
-
breq .end
|
48
|
-
|
49
|
-
mov r19,r18 ; copy a
|
50
|
-
andi r19,1 ; is a % 2 == 0
|
51
|
-
breq .skip
|
52
|
-
|
53
|
-
add r24,r22 ; add b to sum
|
54
|
-
adc r25,r23
|
55
|
-
|
56
|
-
.skip:
|
57
|
-
lsr r18 ; divide a by 2
|
58
|
-
|
59
|
-
clc
|
60
|
-
rol r22 ; multiply b by 2
|
61
|
-
rol r23
|
62
|
-
rjmp .loop
|
63
|
-
|
64
|
-
.end:
|
65
|
-
ret
|
66
|
-
.size product, .-product
|
67
|
-
</span><span class="constant"> CODE</span>
|
68
|
-
<span class="punct">)</span>
|
69
|
-
<span class="keyword">end</span>
|
70
|
-
</pre>
|
71
|
-
</pre>
|
72
|
-
</body>
|
73
|
-
</html>
|
@@ -1,39 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>gps_reader.rb.html</title
|
4
|
-
<style type="text/css">
|
5
|
-
|
6
|
-
.ruby .normal {}
|
7
|
-
.ruby .comment { color: #888; font-style: italic; }
|
8
|
-
.ruby .keyword { color: #A00; font-weight: bold; }
|
9
|
-
.ruby .method { color: #077; }
|
10
|
-
.ruby .class { color: #074; }
|
11
|
-
.ruby .module { color: #050; }
|
12
|
-
.ruby .punct { color: #447; font-weight: bold; }
|
13
|
-
.ruby .symbol { color: #099; }
|
14
|
-
.ruby .string { color: #944; }
|
15
|
-
.ruby .char { color: #F07; }
|
16
|
-
.ruby .ident { color: #004; }
|
17
|
-
.ruby .constant { color: #07F; }
|
18
|
-
.ruby .regex { color: #B66; }
|
19
|
-
.ruby .number { color: #D55; }
|
20
|
-
.ruby .attribute { color: #377; }
|
21
|
-
.ruby .global { color: #3B7; }
|
22
|
-
.ruby .expr { color: #227; }
|
23
|
-
</style>
|
24
|
-
</head>
|
25
|
-
<body>
|
26
|
-
<pre class="ruby">
|
27
|
-
<pre><span class="keyword">class </span><span class="class">GpsReader</span> <span class="punct"><</span> <span class="constant">ArduinoSketch</span>
|
28
|
-
<span class="ident">output_pin</span> <span class="number">13</span><span class="punct">,</span> <span class="symbol">:as</span> <span class="punct">=></span> <span class="symbol">:led</span>
|
29
|
-
<span class="ident">software_serial</span> <span class="number">6</span><span class="punct">,</span> <span class="number">7</span><span class="punct">,</span> <span class="symbol">:as</span> <span class="punct">=></span> <span class="symbol">:gps</span>
|
30
|
-
<span class="ident">serial_begin</span>
|
31
|
-
|
32
|
-
<span class="keyword">def </span><span class="method">loop</span>
|
33
|
-
<span class="ident">digitalWrite</span><span class="punct">(</span><span class="ident">led</span><span class="punct">,</span> <span class="constant">true</span><span class="punct">)</span>
|
34
|
-
<span class="ident">serial_print</span><span class="punct">(</span><span class="ident">gps</span><span class="punct">.</span><span class="ident">read</span><span class="punct">)</span>
|
35
|
-
<span class="keyword">end</span>
|
36
|
-
<span class="keyword">end</span></pre>
|
37
|
-
</pre>
|
38
|
-
</body>
|
39
|
-
</html>
|
@@ -1,38 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>hello_world.rb.html</title
|
4
|
-
<style type="text/css">
|
5
|
-
|
6
|
-
.ruby .normal {}
|
7
|
-
.ruby .comment { color: #888; font-style: italic; }
|
8
|
-
.ruby .keyword { color: #A00; font-weight: bold; }
|
9
|
-
.ruby .method { color: #077; }
|
10
|
-
.ruby .class { color: #074; }
|
11
|
-
.ruby .module { color: #050; }
|
12
|
-
.ruby .punct { color: #447; font-weight: bold; }
|
13
|
-
.ruby .symbol { color: #099; }
|
14
|
-
.ruby .string { color: #944; }
|
15
|
-
.ruby .char { color: #F07; }
|
16
|
-
.ruby .ident { color: #004; }
|
17
|
-
.ruby .constant { color: #07F; }
|
18
|
-
.ruby .regex { color: #B66; }
|
19
|
-
.ruby .number { color: #D55; }
|
20
|
-
.ruby .attribute { color: #377; }
|
21
|
-
.ruby .global { color: #3B7; }
|
22
|
-
.ruby .expr { color: #227; }
|
23
|
-
</style>
|
24
|
-
</head>
|
25
|
-
<body>
|
26
|
-
<pre class="ruby">
|
27
|
-
<pre><span class="comment"># Hardware: LED connected on pin 7</span>
|
28
|
-
|
29
|
-
<span class="keyword">class </span><span class="class">HelloWorld</span> <span class="punct"><</span> <span class="constant">ArduinoSketch</span>
|
30
|
-
<span class="ident">output_pin</span> <span class="number">7</span><span class="punct">,</span> <span class="symbol">:as</span> <span class="punct">=></span> <span class="symbol">:led</span>
|
31
|
-
<span class="keyword">def </span><span class="method">loop</span>
|
32
|
-
<span class="ident">blink</span> <span class="ident">led</span><span class="punct">,</span> <span class="number">500</span>
|
33
|
-
<span class="keyword">end</span>
|
34
|
-
<span class="keyword">end</span>
|
35
|
-
</pre>
|
36
|
-
</pre>
|
37
|
-
</body>
|
38
|
-
</html>
|
@@ -1,41 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>serial_motor.rb.html</title
|
4
|
-
<style type="text/css">
|
5
|
-
|
6
|
-
.ruby .normal {}
|
7
|
-
.ruby .comment { color: #888; font-style: italic; }
|
8
|
-
.ruby .keyword { color: #A00; font-weight: bold; }
|
9
|
-
.ruby .method { color: #077; }
|
10
|
-
.ruby .class { color: #074; }
|
11
|
-
.ruby .module { color: #050; }
|
12
|
-
.ruby .punct { color: #447; font-weight: bold; }
|
13
|
-
.ruby .symbol { color: #099; }
|
14
|
-
.ruby .string { color: #944; }
|
15
|
-
.ruby .char { color: #F07; }
|
16
|
-
.ruby .ident { color: #004; }
|
17
|
-
.ruby .constant { color: #07F; }
|
18
|
-
.ruby .regex { color: #B66; }
|
19
|
-
.ruby .number { color: #D55; }
|
20
|
-
.ruby .attribute { color: #377; }
|
21
|
-
.ruby .global { color: #3B7; }
|
22
|
-
.ruby .expr { color: #227; }
|
23
|
-
</style>
|
24
|
-
</head>
|
25
|
-
<body>
|
26
|
-
<pre class="ruby">
|
27
|
-
<pre><span class="comment"># Hardware: motor control circuit (i.e. TIP-120 control pin)</span>
|
28
|
-
<span class="comment"># connected at pin 7.</span>
|
29
|
-
<span class="comment"># Demo: http://www.youtube.com/watch?v=7OguEBfdTe0</span>
|
30
|
-
|
31
|
-
<span class="keyword">class </span><span class="class">SerialMotor</span> <span class="punct"><</span> <span class="constant">ArduinoSketch</span>
|
32
|
-
<span class="ident">output_pin</span> <span class="number">7</span><span class="punct">,</span> <span class="symbol">:as</span> <span class="punct">=></span> <span class="symbol">:motor</span>
|
33
|
-
<span class="ident">serial_begin</span>
|
34
|
-
|
35
|
-
<span class="keyword">def </span><span class="method">loop</span>
|
36
|
-
<span class="ident">digitalWrite</span><span class="punct">(</span><span class="ident">motor</span><span class="punct">,</span> <span class="ident">serial_read</span><span class="punct">)</span> <span class="keyword">if</span> <span class="ident">serial_available</span>
|
37
|
-
<span class="keyword">end</span>
|
38
|
-
<span class="keyword">end</span></pre>
|
39
|
-
</pre>
|
40
|
-
</body>
|
41
|
-
</html>
|
data/website/index.html
DELETED
@@ -1,178 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
-
<title>
|
8
|
-
RAD
|
9
|
-
</title>
|
10
|
-
<script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
|
11
|
-
<style>
|
12
|
-
.movie {float: left; margin-right: 10px; margin-bottom: 10px;}
|
13
|
-
</style>
|
14
|
-
<script type="text/javascript">
|
15
|
-
window.onload = function() {
|
16
|
-
settings = {
|
17
|
-
tl: { radius: 10 },
|
18
|
-
tr: { radius: 10 },
|
19
|
-
bl: { radius: 10 },
|
20
|
-
br: { radius: 10 },
|
21
|
-
antiAlias: true,
|
22
|
-
autoPad: true,
|
23
|
-
validTags: ["div"]
|
24
|
-
}
|
25
|
-
var versionBox = new curvyCorners(settings, document.getElementById("version"));
|
26
|
-
versionBox.applyCornersToAll();
|
27
|
-
}
|
28
|
-
</script>
|
29
|
-
</head>
|
30
|
-
<body>
|
31
|
-
<div id="main">
|
32
|
-
<div id="metadata">
|
33
|
-
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/rad"; return false'>
|
34
|
-
<p>Get Version</p>
|
35
|
-
<a href="http://rubyforge.org/projects/rad" class="numbers">0.2.2</a>
|
36
|
-
</div>
|
37
|
-
<div id="buy-arduino">
|
38
|
-
<h3>Sponsored by:</h3>
|
39
|
-
<h4>The Shoppe at Wulfden</h4>
|
40
|
-
<a href="http://www.wulfden.org/freeduino/freeduino.shtml">
|
41
|
-
<img src="http://www.wulfden.org/freeduino/freeduino-1.jpg" /><br />
|
42
|
-
</a>
|
43
|
-
<h4><a href="http://www.wulfden.org/freeduino/freeduino.shtml">Totally Open Arduino-Compatible Hardware</a></h4>
|
44
|
-
|
45
|
-
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
<h1>RAD</h1>
|
49
|
-
<h1>→ ‘Ruby Arduino Development’</h1>
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
<h2>What?</h2>
|
55
|
-
|
56
|
-
|
57
|
-
<p><span class="caps">RAD</span> is a framework for programming the Arduino physcial computing platform using Ruby. <span class="caps">RAD</span> converts Ruby scripts written using a set of Rails-like conventions and helpers into C source code which can be compiled and run on the Arduino microcontroller. It also provides a set of Rake tasks for automating the compilation and upload process.</p>
|
58
|
-
|
59
|
-
<br style="clear:both" />
|
60
|
-
|
61
|
-
<h2>Demo: 'Hello World'</h2>
|
62
|
-
|
63
|
-
<p>Here's a basic demo of <span class="caps">RAD</span> in action. In this movie, we'll write, compile, and upload the universal physical computing 'Hello World': a single flashing LED.
|
64
|
-
<div class="movie"><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/AKbHcMaC_cA&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/AKbHcMaC_cA&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></div>
|
65
|
-
<em>Note: This movie was made using an old version of the Arduino board which required a hardware reset before being able to accept a new sketch. More recent versions of the board don't have this requirement and hence as of version 0.2.0, <span class="caps">RAD</span> no longer prompts for reset when running 'rake make:upload' (thought the option is still available for older boards.)</em>
|
66
|
-
</p>
|
67
|
-
<br style="clear:both" />
|
68
|
-
<h2>Why?</h2>
|
69
|
-
|
70
|
-
|
71
|
-
<p>While duplicating the functionality of the well-designed Arduino software interface in Ruby may seem like an odd or redundant goal, <span class="caps">RAD</span> has further ambitions! Bootstrapping the ability to write microcontroller code in a high level dynamic language like Ruby could greatly ease the creation of all the luxurious development aids the users of such a language have come to expect: developer testing, platform independence, easy metaprogramming, etc.</p>
|
72
|
-
|
73
|
-
|
74
|
-
<h2>Installing</h2>
|
75
|
-
|
76
|
-
|
77
|
-
<p><code>$ sudo gem install rad</code></p>
|
78
|
-
|
79
|
-
|
80
|
-
<p>You’ll also need to have the Arduino environment installed, which you can get from <a href="http://www.arduino.cc/en/Main/Software">the Arduino website</a>. <span class="caps">RAD</span> currently requires Arduino 0011, but we try to keep it up-to-date with new Arduino releases.</p>
|
81
|
-
|
82
|
-
|
83
|
-
<h2>The Basics</h2>
|
84
|
-
|
85
|
-
|
86
|
-
<p><code>$ rad my_sketch</code></p>
|
87
|
-
|
88
|
-
|
89
|
-
<p>This command will create a new <span class="caps">RAD</span> project directory (my_sketch/) inside of the current directory that contains a blank script in which you can write your own <span class="caps">RAD</span> code, as well as a full install of the <span class="caps">RAD</span> support infrastructure (in vendor/). A sample ‘hello world’ script in <span class="caps">RAD</span> will look like this:</p>
|
90
|
-
|
91
|
-
|
92
|
-
<pre syntax="ruby">
|
93
|
-
class MySketch < ArduinoSketch
|
94
|
-
output_pin 7, :as => :led
|
95
|
-
def loop
|
96
|
-
blink led, 500
|
97
|
-
end
|
98
|
-
end
|
99
|
-
</pre>
|
100
|
-
|
101
|
-
<p>Once your code is written, your relevant local configuration properly setup in <code>config/hardware.rb</code> and <code>config/software.rb</code>, and an Arduino with the corresponding circuit (a 220ohm resistor and an <span class="caps">LED</span> wired in series between Arduino pin 7 and ground) is connected to your computer via serial, run:</p>
|
102
|
-
|
103
|
-
|
104
|
-
<p><code>$ rake make:upload</code></p>
|
105
|
-
|
106
|
-
|
107
|
-
<p>This will:</p>
|
108
|
-
|
109
|
-
|
110
|
-
<ul>
|
111
|
-
<li>generate the correct Arduino C++ code from your sketch</li>
|
112
|
-
<li>dynamically prepare a localized version of the default Arduino Makefile</li>
|
113
|
-
<li>compile your sketch</li>
|
114
|
-
<li>prompt you to hit the reset button on your Arduino (if necessary!)</li>
|
115
|
-
<li>upload your compiled binary onto your Arduino</li>
|
116
|
-
</ul>
|
117
|
-
|
118
|
-
|
119
|
-
<h2>Documentation and The Arduino <span class="caps">API</span></h2>
|
120
|
-
|
121
|
-
|
122
|
-
<p>Most of <a href="http://www.arduino.cc/en/Reference/HomePage">the Arduino software <span class="caps">API</span></a> should be working correctly at this point. Documentation for RAD's version of things and details about usage of the wider Arduino API are available in the <a href="http://rad.rubyforge.org/rdoc">RAD rDocs</a>.</p>
|
123
|
-
|
124
|
-
<h2>Demo: Serial Communication</h2>
|
125
|
-
<p>
|
126
|
-
To demonstrate some of the more advanced features of <span class="caps">RAD</span>, here's a movie showing how to program the Arduino to listen to serial communication from a computer.
|
127
|
-
<div class="movie">
|
128
|
-
<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/7OguEBfdTe0&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/7OguEBfdTe0&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object> </div>
|
129
|
-
|
130
|
-
<em>Note: The same comment from above applies here about the hardware reset. Also, extra points are available if you recognize the logo on the flag in the video.</em>
|
131
|
-
</p>
|
132
|
-
<br style="clear:both" />
|
133
|
-
|
134
|
-
<p>For more examples of <span class="caps">RAD</span> in action, see <a href="http://rad.rubyforge.org/examples">the RAD example directory</a>.</p>
|
135
|
-
<h2><span class="caps">RAD</span> Needs You!</h2>
|
136
|
-
|
137
|
-
|
138
|
-
<p>All the many discipline-crossing skills required for a project like <span class="caps">RAD</span> make for lots of opportunities to help out: Have you written lots of sketches exploring the obscure depths of the Arduino library? Do you run the Arduino development tool chain on an obscure (i.e., non-OS X) platform? Do you develop for other <span class="caps">AVR</span> or <span class="caps">PIC</span> microcontrollers? Are you a C/C++ ninja? Or even C/C++ competent?</p>
|
139
|
-
|
140
|
-
|
141
|
-
<p>There’s lots to do.</p>
|
142
|
-
|
143
|
-
|
144
|
-
<p>If you’re looking for a place to dive in and don’t know quite where, <a href="mailto:ruby-arduino-development@googlegroups.com">email the RAD Google Group</a>; we're friendly! If you want to start by taking a look at the code, check out RAD on GitHub: <code>http://github.com/atduskgreg/rad/tree/master</code>.</p>
|
145
|
-
|
146
|
-
|
147
|
-
<h2>License</h2>
|
148
|
-
|
149
|
-
|
150
|
-
<p>This code is free to use under the terms of the <span class="caps">GPL</span> 2.0 license, just like the Arduino software library itself.</p>
|
151
|
-
|
152
|
-
|
153
|
-
<h2>Contact</h2>
|
154
|
-
|
155
|
-
|
156
|
-
<p>Comments, questions, heckles, attacks, praises, and, (most especially) patches and contributions are welcome! Send email to <a href="mailto:ruby-arduino-development@googlegroups.com">the RAD mailing list</a>.</p>
|
157
|
-
|
158
|
-
<h2>Who</h2>
|
159
|
-
<p><a href="http://urbanhonking.com/ideasfordozens">Greg Borenstein</a> is RAD's original author and main maintainer with significant contributions from <a href="http://blog.bleything.net/">Ben Bleything</a> and <a href="http://www.wulfden.org/TheShoppe.shtml">Brian Riley</a>, patches from Scott Windsor and David Michael, and the support of the <a href="http://groups.google.com/group/ruby-arduino-development">the Ruby Arduino Development Google Group</a>.</p>
|
160
|
-
|
161
|
-
<p class="coda">
|
162
|
-
<a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 18th November 2007<br>
|
163
|
-
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
164
|
-
</p>
|
165
|
-
</div>
|
166
|
-
|
167
|
-
<!-- insert site tracking codes here, like Google Urchin -->
|
168
|
-
<script type="text/javascript">
|
169
|
-
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
170
|
-
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
171
|
-
</script>
|
172
|
-
<script type="text/javascript">
|
173
|
-
var pageTracker = _gat._getTracker("UA-3885443-1");
|
174
|
-
pageTracker._initData();
|
175
|
-
pageTracker._trackPageview();
|
176
|
-
</script>
|
177
|
-
</body>
|
178
|
-
</html>
|
data/website/index.txt
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
h1. RAD
|
2
|
-
|
3
|
-
h1. → 'Ruby Arduino Development'
|
4
|
-
|
5
|
-
h2. What?
|
6
|
-
|
7
|
-
RAD is a framework for programming the Arduino physcial computing platform using Ruby. RAD converts Ruby scripts written using a set of Rails-like conventions and helpers into C source code which can be compiled and run on the Arduino microcontroller. It also provides a set of Rake tasks for automating the compilation and upload process.
|
8
|
-
|
9
|
-
h2. Why?
|
10
|
-
|
11
|
-
While duplicating the functionality of the well-designed Arduino software interface in Ruby may seem like an odd or redundant goal, RAD has further ambitions! Bootstrapping the ability to write microcontroller code in a high level dynamic language like Ruby could greatly ease the creation of all the luxurious development aids the users of such a language have come to expect: developer testing, platform independence, easy metaprogramming, etc.
|
12
|
-
|
13
|
-
h2. Installing
|
14
|
-
|
15
|
-
@$ sudo gem install rad@
|
16
|
-
|
17
|
-
You'll also need to have the Arduino environment installed, which you can get from "the Arduino website":http://www.arduino.cc/en/Main/Software. RAD currently requires Arduino 0010, but we try to keep it up-to-date with new Arduino releases.
|
18
|
-
|
19
|
-
h2. The Basics
|
20
|
-
|
21
|
-
@$ rad my_sketch@
|
22
|
-
|
23
|
-
This command will create a new RAD project directory (my_sketch/) inside of the current directory that contains a blank script in which you can write your own RAD code, as well as a full install of the RAD support infrastructure (in vendor/). A sample 'hello world' script in RAD will look like this:
|
24
|
-
|
25
|
-
<pre syntax="ruby">
|
26
|
-
class MySketch < ArduinoSketch
|
27
|
-
output_pin 7, :as => :led
|
28
|
-
def loop
|
29
|
-
blink led, 500
|
30
|
-
end
|
31
|
-
end
|
32
|
-
</pre>
|
33
|
-
|
34
|
-
Once your code is written, your relevant local configuration properly setup in @config/hardware.rb@ and @config/software.rb@, and an Arduino with the corresponding circuit (a 220ohm resistor and an LED wired in series between Arduino pin 7 and ground) is connected to your computer via serial, run:
|
35
|
-
|
36
|
-
@$ rake make:upload@
|
37
|
-
|
38
|
-
This will:
|
39
|
-
|
40
|
-
* generate the correct Arduino C++ code from your sketch
|
41
|
-
* dynamically prepare a localized version of the default Arduino Makefile
|
42
|
-
* compile your sketch
|
43
|
-
* prompt you to hit the reset button on your Arduino (if necessary!)
|
44
|
-
* upload your compiled binary onto your Arduino
|
45
|
-
|
46
|
-
h2. The Arduino API
|
47
|
-
|
48
|
-
With the exception of the still-experimental Serial interface, most of <a href="http://www.arduino.cc/en/Reference/HomePage">the Arduino software API</a> should be working correctly at this point. Documentation for the Ruby versions of the methods is forthcoming, but it is mostly what you'd expect: methods with identical names and arguments to their Arduino counterparts with the exception of using 'true' and 'false' for HIGH and LOW.
|
49
|
-
|
50
|
-
h2. RAD Needs You!
|
51
|
-
|
52
|
-
All the many discipline-crossing skills required for a project like RAD make for lots of opportunities to help out: Have you written lots of sketches exploring the obscure depths of the Arduino library? Do you run the Arduino development tool chain on an obscure (i.e., non-OS X) platform? Do you develop for other AVR or PIC microcontrollers? Are you a C/C++ ninja? Or even C/C++ competent?
|
53
|
-
|
54
|
-
There's lots to do.
|
55
|
-
|
56
|
-
If you're looking for a place to dive in and don't know quite where, "email Greg":mailto:greg@grabb.it. If you want to start by taking a log at the code, the trunk repository is @svn://rubyforge.org/var/svn/rad/trunk@ for anonymous access.
|
57
|
-
|
58
|
-
h2. License
|
59
|
-
|
60
|
-
This code is free to use under the terms of the GPL 2.0 license, just like the Arduino software library itself.
|
61
|
-
|
62
|
-
h2. Contact
|
63
|
-
|
64
|
-
Comments, questions, heckles, attacks, praises, and, (most especially) patches and contributions are welcome! Send email to "Greg Borenstein":mailto:greg@grabb.it.
|