subduino 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/bin/subduino +18 -5
- data/duino/Makefile +2 -3
- data/duino/duino.pde +97 -66
- data/lib/subduino/ard_io.rb +33 -14
- data/lib/subduino/ard_ps.rb +47 -24
- data/lib/subduino/os.rb +49 -0
- data/lib/subduino/parse/bool.rb +1 -1
- data/lib/subduino/parse/energy.rb +18 -0
- data/lib/subduino/parse/flow.rb +13 -0
- data/lib/subduino/parse/lux.rb +1 -1
- data/lib/subduino/parse/presence.rb +9 -0
- data/lib/subduino/parse/pressure.rb +13 -0
- data/lib/subduino/parse/temp.rb +1 -1
- data/lib/subduino/parse.rb +3 -3
- data/lib/subduino/scaffold/Makefile +72 -73
- data/lib/subduino/scaffold/scaffold.pde +77 -0
- data/lib/subduino/store.rb +1 -1
- data/spec/subduino/parse_spec.rb +1 -1
- data/subduino.gemspec +8 -249
- metadata +8 -249
- data/webapp/Gemfile +0 -8
- data/webapp/Gemfile.lock +0 -14
- data/webapp/Rakefile +0 -49
- data/webapp/Readme.textile +0 -45
- data/webapp/VERSION +0 -1
- data/webapp/config.yml +0 -20
- data/webapp/lib/app.rb +0 -103
- data/webapp/lib/duino.rb +0 -206
- data/webapp/lib/environment.rb +0 -36
- data/webapp/lib/messenger.rb +0 -16
- data/webapp/public/app.css +0 -119
- data/webapp/public/app.js +0 -34
- data/webapp/public/custom.js +0 -187
- data/webapp/public/date_input.css +0 -149
- data/webapp/public/facebox.css +0 -83
- data/webapp/public/facebox.js +0 -319
- data/webapp/public/favicon.ico +0 -0
- data/webapp/public/faye.js +0 -1
- data/webapp/public/icons/alarm-clock-blue.png +0 -0
- data/webapp/public/icons/alarm-clock.png +0 -0
- data/webapp/public/icons/balloon-left.png +0 -0
- data/webapp/public/icons/bandaid.png +0 -0
- data/webapp/public/icons/bell-disable.png +0 -0
- data/webapp/public/icons/bell.png +0 -0
- data/webapp/public/icons/big_icon.png +0 -0
- data/webapp/public/icons/bomb.png +0 -0
- data/webapp/public/icons/bookmark.png +0 -0
- data/webapp/public/icons/box-label.png +0 -0
- data/webapp/public/icons/brightness-control-up.png +0 -0
- data/webapp/public/icons/brightness-control.png +0 -0
- data/webapp/public/icons/brightness-small.png +0 -0
- data/webapp/public/icons/broom.png +0 -0
- data/webapp/public/icons/bug.png +0 -0
- data/webapp/public/icons/calculator.png +0 -0
- data/webapp/public/icons/calendar-day.png +0 -0
- data/webapp/public/icons/camera.png +0 -0
- data/webapp/public/icons/cards-address.png +0 -0
- data/webapp/public/icons/chart.png +0 -0
- data/webapp/public/icons/clock-select.png +0 -0
- data/webapp/public/icons/color.png +0 -0
- data/webapp/public/icons/compass.png +0 -0
- data/webapp/public/icons/control-power-small.png +0 -0
- data/webapp/public/icons/control-power.png +0 -0
- data/webapp/public/icons/control-record-small.png +0 -0
- data/webapp/public/icons/cpus.png +0 -0
- data/webapp/public/icons/credit-card.png +0 -0
- data/webapp/public/icons/cross-small.png +0 -0
- data/webapp/public/icons/current.png +0 -0
- data/webapp/public/icons/dashboard.png +0 -0
- data/webapp/public/icons/database.png +0 -0
- data/webapp/public/icons/databases.png +0 -0
- data/webapp/public/icons/day.png +0 -0
- data/webapp/public/icons/door-big.png +0 -0
- data/webapp/public/icons/door-open-in.png +0 -0
- data/webapp/public/icons/door-open-out.png +0 -0
- data/webapp/public/icons/door-open.png +0 -0
- data/webapp/public/icons/door.png +0 -0
- data/webapp/public/icons/drive-globe.png +0 -0
- data/webapp/public/icons/equalizer.png +0 -0
- data/webapp/public/icons/exclamation-diamond.png +0 -0
- data/webapp/public/icons/exclamation.png +0 -0
- data/webapp/public/icons/eye-disable.png +0 -0
- data/webapp/public/icons/eye.png +0 -0
- data/webapp/public/icons/false.png +0 -0
- data/webapp/public/icons/favicon.png +0 -0
- data/webapp/public/icons/gear-small.png +0 -0
- data/webapp/public/icons/gear.png +0 -0
- data/webapp/public/icons/groups.png +0 -0
- data/webapp/public/icons/heart.png +0 -0
- data/webapp/public/icons/heart_empty.png +0 -0
- data/webapp/public/icons/info.png +0 -0
- data/webapp/public/icons/irrigation.png +0 -0
- data/webapp/public/icons/key.png +0 -0
- data/webapp/public/icons/lamp-big.png +0 -0
- data/webapp/public/icons/lightbulb.png +0 -0
- data/webapp/public/icons/lightbulb_off.png +0 -0
- data/webapp/public/icons/lightning-disable.png +0 -0
- data/webapp/public/icons/lightning-small.png +0 -0
- data/webapp/public/icons/lightning.png +0 -0
- data/webapp/public/icons/lock-unlock.png +0 -0
- data/webapp/public/icons/lock.png +0 -0
- data/webapp/public/icons/locked.png +0 -0
- data/webapp/public/icons/lux.png +0 -0
- data/webapp/public/icons/marker.png +0 -0
- data/webapp/public/icons/media-player-phone.png +0 -0
- data/webapp/public/icons/megaphone.png +0 -0
- data/webapp/public/icons/mem.png +0 -0
- data/webapp/public/icons/microphone.png +0 -0
- data/webapp/public/icons/monitor.png +0 -0
- data/webapp/public/icons/navigation.png +0 -0
- data/webapp/public/icons/night.png +0 -0
- data/webapp/public/icons/noise.png +0 -0
- data/webapp/public/icons/off.png +0 -0
- data/webapp/public/icons/on.png +0 -0
- data/webapp/public/icons/onoff.png +0 -0
- data/webapp/public/icons/pin.png +0 -0
- data/webapp/public/icons/plug--exclamation.png +0 -0
- data/webapp/public/icons/plug-disable.png +0 -0
- data/webapp/public/icons/plug.png +0 -0
- data/webapp/public/icons/rain.png +0 -0
- data/webapp/public/icons/refrigeration.png +0 -0
- data/webapp/public/icons/restart.png +0 -0
- data/webapp/public/icons/ruby.png +0 -0
- data/webapp/public/icons/server.png +0 -0
- data/webapp/public/icons/shield-disable.png +0 -0
- data/webapp/public/icons/shield.png +0 -0
- data/webapp/public/icons/socket--exclamation.png +0 -0
- data/webapp/public/icons/socket-disable.png +0 -0
- data/webapp/public/icons/socket.png +0 -0
- data/webapp/public/icons/start.png +0 -0
- data/webapp/public/icons/stop.png +0 -0
- data/webapp/public/icons/switch--exclamation.png +0 -0
- data/webapp/public/icons/switch-disable.png +0 -0
- data/webapp/public/icons/switch-small.png +0 -0
- data/webapp/public/icons/switch.png +0 -0
- data/webapp/public/icons/target.png +0 -0
- data/webapp/public/icons/television-off.png +0 -0
- data/webapp/public/icons/television.png +0 -0
- data/webapp/public/icons/temp.png +0 -0
- data/webapp/public/icons/terminal.png +0 -0
- data/webapp/public/icons/tick-small.png +0 -0
- data/webapp/public/icons/traffic-light-off.png +0 -0
- data/webapp/public/icons/traffic-light.png +0 -0
- data/webapp/public/icons/traffic.png +0 -0
- data/webapp/public/icons/true.png +0 -0
- data/webapp/public/icons/umbrella.png +0 -0
- data/webapp/public/icons/unlocked.png +0 -0
- data/webapp/public/icons/unmonitor.png +0 -0
- data/webapp/public/icons/unmonitored.png +0 -0
- data/webapp/public/icons/users.png +0 -0
- data/webapp/public/icons/vcard.png +0 -0
- data/webapp/public/icons/wall.png +0 -0
- data/webapp/public/icons/wall_brick.png +0 -0
- data/webapp/public/icons/wall_disable.png +0 -0
- data/webapp/public/icons/wand-disable.png +0 -0
- data/webapp/public/icons/wand.png +0 -0
- data/webapp/public/icons/warn.png +0 -0
- data/webapp/public/icons/weather_clouds.png +0 -0
- data/webapp/public/icons/weather_cloudy.png +0 -0
- data/webapp/public/icons/weather_lightning.png +0 -0
- data/webapp/public/icons/weather_rain.png +0 -0
- data/webapp/public/icons/weather_snow.png +0 -0
- data/webapp/public/icons/weather_sun.png +0 -0
- data/webapp/public/icons/wrench-screwdriver.png +0 -0
- data/webapp/public/icons/wrench.png +0 -0
- data/webapp/public/images/ajax-loader.gif +0 -0
- data/webapp/public/images/b.png +0 -0
- data/webapp/public/images/bendl.gif +0 -0
- data/webapp/public/images/bendr.gif +0 -0
- data/webapp/public/images/bendsb.gif +0 -0
- data/webapp/public/images/bg.jpg +0 -0
- data/webapp/public/images/bhead.gif +0 -0
- data/webapp/public/images/bheadl.gif +0 -0
- data/webapp/public/images/bheadr.gif +0 -0
- data/webapp/public/images/bl.png +0 -0
- data/webapp/public/images/bnd.gif +0 -0
- data/webapp/public/images/br.png +0 -0
- data/webapp/public/images/bread.gif +0 -0
- data/webapp/public/images/btnb.gif +0 -0
- data/webapp/public/images/btnb_.gif +0 -0
- data/webapp/public/images/btnm.gif +0 -0
- data/webapp/public/images/btnm_.gif +0 -0
- data/webapp/public/images/btns.gif +0 -0
- data/webapp/public/images/btns_.gif +0 -0
- data/webapp/public/images/cal.jpg +0 -0
- data/webapp/public/images/close.png +0 -0
- data/webapp/public/images/closelabel.gif +0 -0
- data/webapp/public/images/error.gif +0 -0
- data/webapp/public/images/ft.gif +0 -0
- data/webapp/public/images/hdr.gif +0 -0
- data/webapp/public/images/hdrl.gif +0 -0
- data/webapp/public/images/hdrr.gif +0 -0
- data/webapp/public/images/hld.jpg +0 -0
- data/webapp/public/images/imgb.gif +0 -0
- data/webapp/public/images/imgo.gif +0 -0
- data/webapp/public/images/imgt.gif +0 -0
- data/webapp/public/images/info.gif +0 -0
- data/webapp/public/images/jquery.wysiwyg.gif +0 -0
- data/webapp/public/images/li.gif +0 -0
- data/webapp/public/images/mbg.png +0 -0
- data/webapp/public/images/nsp.gif +0 -0
- data/webapp/public/images/phs.gif +0 -0
- data/webapp/public/images/sdd.jpg +0 -0
- data/webapp/public/images/sdd_.jpg +0 -0
- data/webapp/public/images/sidebar.gif +0 -0
- data/webapp/public/images/sorta.gif +0 -0
- data/webapp/public/images/sortd.gif +0 -0
- data/webapp/public/images/srch.gif +0 -0
- data/webapp/public/images/srch_.gif +0 -0
- data/webapp/public/images/success.gif +0 -0
- data/webapp/public/images/thumb1.jpg +0 -0
- data/webapp/public/images/thumb2.jpg +0 -0
- data/webapp/public/images/thumb3.jpg +0 -0
- data/webapp/public/images/tiny.gif +0 -0
- data/webapp/public/images/tiny_.gif +0 -0
- data/webapp/public/images/tl.png +0 -0
- data/webapp/public/images/tr.png +0 -0
- data/webapp/public/images/upload.gif +0 -0
- data/webapp/public/images/warning.gif +0 -0
- data/webapp/public/iui/backButton.png +0 -0
- data/webapp/public/iui/blueButton.png +0 -0
- data/webapp/public/iui/cancel.png +0 -0
- data/webapp/public/iui/grayButton.png +0 -0
- data/webapp/public/iui/greenButton.png +0 -0
- data/webapp/public/iui/iui-logo-touch-icon.png +0 -0
- data/webapp/public/iui/iui.css +0 -396
- data/webapp/public/iui/iui.js +0 -511
- data/webapp/public/iui/iuix.css +0 -1
- data/webapp/public/iui/iuix.js +0 -1
- data/webapp/public/iui/listArrow.png +0 -0
- data/webapp/public/iui/listArrowSel.png +0 -0
- data/webapp/public/iui/listGroup.png +0 -0
- data/webapp/public/iui/loading.gif +0 -0
- data/webapp/public/iui/pinstripes.png +0 -0
- data/webapp/public/iui/redButton.png +0 -0
- data/webapp/public/iui/selection.png +0 -0
- data/webapp/public/iui/thumb.png +0 -0
- data/webapp/public/iui/toggle.png +0 -0
- data/webapp/public/iui/toggleOn.png +0 -0
- data/webapp/public/iui/toolButton.png +0 -0
- data/webapp/public/iui/toolbar.png +0 -0
- data/webapp/public/iui/whiteButton.png +0 -0
- data/webapp/public/iui/yellowButton.png +0 -0
- data/webapp/public/jquery.img.preload.js +0 -152
- data/webapp/public/jquery.js +0 -154
- data/webapp/public/jquery.sparkline.js +0 -85
- data/webapp/public/jquery.tablesorter.min.js +0 -2
- data/webapp/public/jquery.visualize.js +0 -452
- data/webapp/public/jquery.wysiwyg.css +0 -56
- data/webapp/public/layout.css +0 -33
- data/webapp/public/right.js +0 -9
- data/webapp/public/rt.js +0 -7
- data/webapp/public/sparkline.js +0 -85
- data/webapp/public/style.css +0 -881
- data/webapp/public/visualize.css +0 -32
- data/webapp/spec/duino_spec.rb +0 -8
- data/webapp/spec/spec_helper.rb +0 -10
- data/webapp/views/command.haml +0 -4
- data/webapp/views/icon.haml +0 -6
- data/webapp/views/index.haml +0 -367
- data/webapp/views/layout.haml +0 -88
- data/webapp/views/mobile.haml +0 -21
- data/webapp/views/switch.haml +0 -56
- data/webapp/views/template.haml +0 -676
- data/webapp/views/top.haml +0 -4
- data/webapp/views/watch.haml +0 -26
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
#
|
|
2
2
|
#
|
|
3
3
|
# !!SCAFFOLD!! Arduino command line tools Makefile
|
|
4
|
-
#
|
|
4
|
+
#
|
|
5
5
|
#
|
|
6
6
|
# Copyright (C) 2010 Martin Oldfield <m@mjo.tc>, based on work that is
|
|
7
7
|
# Copyright Nicholas Zambetti, David A. Mellis & Hernando Barragan
|
|
8
8
|
#
|
|
9
9
|
# See footer for copyright/changelog....
|
|
10
|
-
#
|
|
10
|
+
#
|
|
11
11
|
|
|
12
12
|
#
|
|
13
13
|
# CONFIGURATION [EDIT ME]
|
|
14
14
|
#
|
|
15
15
|
TARGET = !!SCAFFOLD!!
|
|
16
16
|
ARDUINO_DIR = /usr/share/arduino
|
|
17
|
-
ARDUINO_LIBS =
|
|
17
|
+
#ARDUINO_LIBS = ExtraLib
|
|
18
18
|
|
|
19
19
|
# Board
|
|
20
20
|
MCU = atmega328p
|
|
21
21
|
F_CPU = 16000000
|
|
22
|
-
ARDUINO_PORT = /dev/ttyUSB*
|
|
22
|
+
ARDUINO_PORT = /dev/ttyUSB*
|
|
23
23
|
|
|
24
24
|
# Linux
|
|
25
25
|
AVR_TOOLS_PATH = /usr/bin
|
|
@@ -29,7 +29,6 @@ AVRDUDE_CONF = /usr/share/arduino/hardware/tools/avrdude.conf
|
|
|
29
29
|
AVRDUDE_ARD_PROGRAMMER = stk500v1
|
|
30
30
|
AVRDUDE_ARD_BAUDRATE = 57600
|
|
31
31
|
|
|
32
|
-
# INC_DIRS = ./vendor/Messenger
|
|
33
32
|
#
|
|
34
33
|
# Hopefully these will be self-explanatory but in case they're not:
|
|
35
34
|
#
|
|
@@ -44,8 +43,8 @@ AVRDUDE_ARD_BAUDRATE = 57600
|
|
|
44
43
|
# when uploading
|
|
45
44
|
#
|
|
46
45
|
# ARDUINO WITH OTHER TOOLS
|
|
47
|
-
#
|
|
48
|
-
# If the tools aren't in the Arduino distribution, then you need to
|
|
46
|
+
#
|
|
47
|
+
# If the tools aren't in the Arduino distribution, then you need to
|
|
49
48
|
# specify their location:
|
|
50
49
|
#
|
|
51
50
|
# AVR_TOOLS_PATH = /usr/bin
|
|
@@ -76,9 +75,9 @@ AVRDUDE_ARD_BAUDRATE = 57600
|
|
|
76
75
|
# You need to specify some details of your ISP programmer and might
|
|
77
76
|
# also need to specify the fuse values:
|
|
78
77
|
#
|
|
79
|
-
# ISP_PROG
|
|
78
|
+
# ISP_PROG = -c stk500v2
|
|
80
79
|
# ISP_PORT = /dev/ttyACM0
|
|
81
|
-
#
|
|
80
|
+
#
|
|
82
81
|
# ISP_LOCK_FUSE_PRE = 0x3f
|
|
83
82
|
# ISP_LOCK_FUSE_POST = 0xcf
|
|
84
83
|
# ISP_HIGH_FUSE = 0xdf
|
|
@@ -87,7 +86,7 @@ AVRDUDE_ARD_BAUDRATE = 57600
|
|
|
87
86
|
#
|
|
88
87
|
# I think the fuses here are fine for uploading to the ATmega168
|
|
89
88
|
# without bootloader.
|
|
90
|
-
#
|
|
89
|
+
#
|
|
91
90
|
# To actually do this upload use the ispload target:
|
|
92
91
|
#
|
|
93
92
|
# make ispload
|
|
@@ -117,7 +116,7 @@ ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/arduino/cores/arduino
|
|
|
117
116
|
endif
|
|
118
117
|
|
|
119
118
|
# Everything gets built in here
|
|
120
|
-
OBJDIR
|
|
119
|
+
OBJDIR = build-cli
|
|
121
120
|
|
|
122
121
|
########################################################################
|
|
123
122
|
# Local sources
|
|
@@ -128,8 +127,8 @@ LOCAL_CC_SRCS = $(wildcard *.cc)
|
|
|
128
127
|
LOCAL_PDE_SRCS = $(wildcard *.pde)
|
|
129
128
|
LOCAL_AS_SRCS = $(wildcard *.S)
|
|
130
129
|
LOCAL_OBJ_FILES = $(LOCAL_C_SRCS:.c=.o) $(LOCAL_CPP_SRCS:.cpp=.o) \
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
$(LOCAL_CC_SRCS:.cc=.o) $(LOCAL_PDE_SRCS:.pde=.o) \
|
|
131
|
+
$(LOCAL_AS_SRCS:.S=.o)
|
|
133
132
|
LOCAL_OBJS = $(patsubst %,$(OBJDIR)/%,$(LOCAL_OBJ_FILES))
|
|
134
133
|
|
|
135
134
|
# Dependency files
|
|
@@ -140,8 +139,8 @@ ifeq ($(strip $(NO_CORE)),)
|
|
|
140
139
|
ifdef ARDUINO_CORE_PATH
|
|
141
140
|
CORE_C_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.c)
|
|
142
141
|
CORE_CPP_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.cpp)
|
|
143
|
-
EXTRA_CPP_SRCS = $(wildcard $(ARDUINO_LIB_PATH)/
|
|
144
|
-
CORE_OBJ_FILES = $(CORE_C_SRCS:.c=.o) $(CORE_CPP_SRCS:.cpp=.o) $(EXTRA_CPP_SRCS:.cpp=.o)
|
|
142
|
+
# EXTRA_CPP_SRCS = $(wildcard $(ARDUINO_LIB_PATH)/ExtraLib/*.cpp)
|
|
143
|
+
CORE_OBJ_FILES = $(CORE_C_SRCS:.c=.o) $(CORE_CPP_SRCS:.cpp=.o) $(EXTRA_CPP_SRCS:.cpp=.o)
|
|
145
144
|
CORE_OBJS = $(patsubst $(ARDUINO_CORE_PATH)/%, $(OBJDIR)/%,$(CORE_OBJ_FILES))
|
|
146
145
|
endif
|
|
147
146
|
endif
|
|
@@ -180,9 +179,9 @@ SYS_INCLUDES = $(patsubst %,-I%,$(SYS_LIBS))
|
|
|
180
179
|
SYS_OBJS = $(wildcard $(patsubst %,%/*.o,$(SYS_LIBS)))
|
|
181
180
|
|
|
182
181
|
CPPFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) \
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
-I. -I$(ARDUINO_CORE_PATH) \
|
|
183
|
+
$(SYS_INCLUDES) -g -Os -w -Wall \
|
|
184
|
+
-ffunction-sections -fdata-sections
|
|
186
185
|
CFLAGS = -std=gnu99
|
|
187
186
|
CXXFLAGS = -fno-exceptions
|
|
188
187
|
ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp
|
|
@@ -206,66 +205,66 @@ ARD_PORT = $(firstword $(wildcard $(ARDUINO_PORT)))
|
|
|
206
205
|
# .o rules are for objects, .d for dependency tracking
|
|
207
206
|
# there seems to be an awful lot of duplication here!!!
|
|
208
207
|
$(OBJDIR)/%.o: %.c
|
|
209
|
-
|
|
208
|
+
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
210
209
|
|
|
211
210
|
$(OBJDIR)/%.o: %.cc
|
|
212
|
-
|
|
211
|
+
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
|
213
212
|
|
|
214
213
|
$(OBJDIR)/%.o: %.cpp
|
|
215
|
-
|
|
214
|
+
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
|
216
215
|
|
|
217
216
|
$(OBJDIR)/%.o: %.S
|
|
218
|
-
|
|
217
|
+
$(CC) -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
|
219
218
|
|
|
220
219
|
$(OBJDIR)/%.o: %.s
|
|
221
|
-
|
|
220
|
+
$(CC) -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
|
222
221
|
|
|
223
222
|
$(OBJDIR)/%.d: %.c
|
|
224
|
-
|
|
223
|
+
$(CC) -MM $(CPPFLAGS) $(CFLAGS) $< -MF $@ -MT $(@:.d=.o)
|
|
225
224
|
|
|
226
225
|
$(OBJDIR)/%.d: %.cc
|
|
227
|
-
|
|
226
|
+
$(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $< -MF $@ -MT $(@:.d=.o)
|
|
228
227
|
|
|
229
228
|
$(OBJDIR)/%.d: %.cpp
|
|
230
|
-
|
|
229
|
+
$(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $< -MF $@ -MT $(@:.d=.o)
|
|
231
230
|
|
|
232
231
|
$(OBJDIR)/%.d: %.S
|
|
233
|
-
|
|
232
|
+
$(CC) -MM $(CPPFLAGS) $(ASFLAGS) $< -MF $@ -MT $(@:.d=.o)
|
|
234
233
|
|
|
235
234
|
$(OBJDIR)/%.d: %.s
|
|
236
|
-
|
|
235
|
+
$(CC) -MM $(CPPFLAGS) $(ASFLAGS) $< -MF $@ -MT $(@:.d=.o)
|
|
237
236
|
|
|
238
237
|
# the pde -> cpp -> o file
|
|
239
238
|
$(OBJDIR)/%.cpp: %.pde
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
$(ECHO) $(PDEHEADER) > $@
|
|
240
|
+
$(CAT) $< >> $@
|
|
242
241
|
|
|
243
242
|
$(OBJDIR)/%.o: $(OBJDIR)/%.cpp
|
|
244
|
-
|
|
243
|
+
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
|
245
244
|
|
|
246
245
|
$(OBJDIR)/%.d: $(OBJDIR)/%.cpp
|
|
247
|
-
|
|
246
|
+
$(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $< -MF $@ -MT $(@:.d=.o)
|
|
248
247
|
|
|
249
248
|
# core files
|
|
250
249
|
$(OBJDIR)/%.o: $(ARDUINO_CORE_PATH)/%.c
|
|
251
|
-
|
|
250
|
+
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
252
251
|
|
|
253
252
|
$(OBJDIR)/%.o: $(ARDUINO_CORE_PATH)/%.cpp
|
|
254
|
-
|
|
253
|
+
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
|
255
254
|
|
|
256
255
|
# various object conversions
|
|
257
256
|
$(OBJDIR)/%.hex: $(OBJDIR)/%.elf
|
|
258
|
-
|
|
257
|
+
$(OBJCOPY) -O ihex -R .eeprom $< $@
|
|
259
258
|
|
|
260
259
|
$(OBJDIR)/%.eep: $(OBJDIR)/%.elf
|
|
261
|
-
|
|
262
|
-
|
|
260
|
+
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
|
261
|
+
--change-section-lma .eeprom=0 -O ihex $< $@
|
|
263
262
|
|
|
264
263
|
$(OBJDIR)/%.lss: $(OBJDIR)/%.elf
|
|
265
|
-
|
|
264
|
+
$(OBJDUMP) -h -S $< > $@
|
|
266
265
|
|
|
267
266
|
$(OBJDIR)/%.sym: $(OBJDIR)/%.elf
|
|
268
|
-
|
|
267
|
+
$(NM) -n $< > $@
|
|
269
268
|
|
|
270
269
|
########################################################################
|
|
271
270
|
#
|
|
@@ -311,7 +310,7 @@ ISP_EXT_FUSE = 0x01
|
|
|
311
310
|
endif
|
|
312
311
|
|
|
313
312
|
ifndef ISP_PROG
|
|
314
|
-
ISP_PROG
|
|
313
|
+
ISP_PROG = -c stk500v2
|
|
315
314
|
endif
|
|
316
315
|
|
|
317
316
|
AVRDUDE_ISP_OPTS = -P $(ISP_PORT) $(ISP_PROG)
|
|
@@ -322,52 +321,52 @@ AVRDUDE_ISP_OPTS = -P $(ISP_PORT) $(ISP_PROG)
|
|
|
322
321
|
# Explicit targets start here
|
|
323
322
|
#
|
|
324
323
|
|
|
325
|
-
all:
|
|
324
|
+
all: $(OBJDIR) $(TARGET_HEX)
|
|
326
325
|
|
|
327
326
|
$(OBJDIR):
|
|
328
|
-
|
|
327
|
+
mkdir $(OBJDIR)
|
|
329
328
|
|
|
330
|
-
$(TARGET_ELF):
|
|
331
|
-
|
|
329
|
+
$(TARGET_ELF): $(OBJS)
|
|
330
|
+
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(SYS_OBJS)
|
|
332
331
|
|
|
333
|
-
$(DEP_FILE):
|
|
334
|
-
|
|
332
|
+
$(DEP_FILE): $(OBJDIR) $(DEPS)
|
|
333
|
+
cat $(DEPS) > $(DEP_FILE)
|
|
335
334
|
|
|
336
|
-
upload:
|
|
335
|
+
upload: reset raw_upload
|
|
337
336
|
|
|
338
|
-
raw_upload:
|
|
339
|
-
|
|
340
|
-
|
|
337
|
+
raw_upload: $(TARGET_HEX)
|
|
338
|
+
$(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \
|
|
339
|
+
-U flash:w:$(TARGET_HEX):i
|
|
341
340
|
|
|
342
341
|
# stty on MacOS likes -F, but on Debian it likes -f redirecting
|
|
343
342
|
# stdin/out appears to work but generates a spurious error on MacOS at
|
|
344
343
|
# least. Perhaps it would be better to just do it in perl ?
|
|
345
|
-
reset:
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
ispload:
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
344
|
+
reset:
|
|
345
|
+
for STTYF in 'stty --file' 'stty -f' 'stty <' ; \
|
|
346
|
+
do $$STTYF /dev/tty >/dev/null 2>/dev/null && break ; \
|
|
347
|
+
done ;\
|
|
348
|
+
$$STTYF $(ARD_PORT) hupcl ;\
|
|
349
|
+
(sleep 0.1 || sleep 1) ;\
|
|
350
|
+
$$STTYF $(ARD_PORT) -hupcl
|
|
351
|
+
|
|
352
|
+
ispload: $(TARGET_HEX)
|
|
353
|
+
$(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ISP_OPTS) -e \
|
|
354
|
+
-U lock:w:$(ISP_LOCK_FUSE_PRE):m \
|
|
355
|
+
-U hfuse:w:$(ISP_HIGH_FUSE):m \
|
|
356
|
+
-U lfuse:w:$(ISP_LOW_FUSE):m \
|
|
357
|
+
-U efuse:w:$(ISP_EXT_FUSE):m
|
|
358
|
+
$(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ISP_OPTS) -D \
|
|
359
|
+
-U flash:w:$(TARGET_HEX):i
|
|
360
|
+
$(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ISP_OPTS) \
|
|
361
|
+
-U lock:w:$(ISP_LOCK_FUSE_POST):m
|
|
363
362
|
|
|
364
363
|
clean:
|
|
365
|
-
|
|
364
|
+
$(REMOVE) $(OBJS) $(TARGETS) $(DEP_FILE) $(DEPS)
|
|
366
365
|
|
|
367
|
-
depends:
|
|
368
|
-
|
|
366
|
+
depends: $(DEPS)
|
|
367
|
+
cat $(DEPS) > $(DEP_FILE)
|
|
369
368
|
|
|
370
|
-
.PHONY:
|
|
369
|
+
.PHONY: all clean depends upload raw_upload reset
|
|
371
370
|
|
|
372
371
|
include $(DEP_FILE)
|
|
373
372
|
|
|
@@ -375,7 +374,7 @@ include $(DEP_FILE)
|
|
|
375
374
|
#
|
|
376
375
|
# This makefile is from:
|
|
377
376
|
# http://mjo.tc/atelier/2009/02/arduino-cli.html
|
|
378
|
-
#
|
|
377
|
+
#
|
|
379
378
|
# With some help:
|
|
380
379
|
#
|
|
381
380
|
# http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1265576847
|
|
@@ -8,10 +8,87 @@
|
|
|
8
8
|
|
|
9
9
|
#include <Messenger.h>
|
|
10
10
|
|
|
11
|
+
#define sec 1000
|
|
12
|
+
#define min 60000
|
|
13
|
+
#define hour 3600000
|
|
14
|
+
#define day 86400000
|
|
15
|
+
|
|
16
|
+
// Output
|
|
17
|
+
const int rxPin = 0;
|
|
18
|
+
const int txPin = 1;
|
|
19
|
+
const int d2 = 2;
|
|
20
|
+
const int d3 = 3;
|
|
21
|
+
const int d4 = 4;
|
|
22
|
+
const int d5 = 5;
|
|
23
|
+
const int d6 = 6;
|
|
24
|
+
const int d7 = 7;
|
|
25
|
+
const int d8 = 8;
|
|
26
|
+
const int d9 = 9;
|
|
27
|
+
//const int d10 = 10;
|
|
28
|
+
//const int d11 = 11;
|
|
29
|
+
//const int d12 = 12;
|
|
30
|
+
const int infoPin = 13;
|
|
31
|
+
|
|
32
|
+
// Input
|
|
33
|
+
const int i0 = A0;
|
|
34
|
+
const int i1 = A1;
|
|
35
|
+
const int i2 = A2;
|
|
36
|
+
const int i3 = A3;
|
|
37
|
+
const int i4 = A4;
|
|
38
|
+
const int i5 = A5;
|
|
39
|
+
// Digital
|
|
40
|
+
const int d10 = 10;
|
|
41
|
+
const int d11 = 11;
|
|
42
|
+
const int d12 = 12;
|
|
43
|
+
|
|
44
|
+
Messenger message = Messenger();
|
|
45
|
+
|
|
46
|
+
// Create the callback function
|
|
47
|
+
|
|
48
|
+
unsigned long mintomilli(unsigned long m) {
|
|
49
|
+
return(m * 60000);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
void messageReady() {
|
|
53
|
+
int pin = 2;
|
|
54
|
+
int val = 0;
|
|
55
|
+
// Loop through all the available elements of the message
|
|
56
|
+
while ( message.available() && pin <= infoPin ) {
|
|
57
|
+
val = message.readInt();
|
|
58
|
+
// Set the pin as determined by the message
|
|
59
|
+
analogWrite(pin, val);
|
|
60
|
+
pin = pin + 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
11
65
|
void setup() {
|
|
66
|
+
// Atmega defaults INPUT
|
|
67
|
+
pinMode(infoPin, OUTPUT);
|
|
12
68
|
|
|
69
|
+
Serial.begin(115200);
|
|
70
|
+
message.attach(messageReady);
|
|
13
71
|
}
|
|
14
72
|
|
|
15
73
|
void loop() {
|
|
16
74
|
|
|
75
|
+
time_now = millis();
|
|
76
|
+
|
|
77
|
+
// Sync over wire
|
|
78
|
+
if ( abs(time_now - last_sync) >= sync) {
|
|
79
|
+
last_sync = time_now;
|
|
80
|
+
sprintf(buffer, "i0:%d,i1:%d,i2:%d,i3:%d,i4:%d,i5:%d,d11:%d,d12:%d",
|
|
81
|
+
analogRead(i0),
|
|
82
|
+
analogRead(i1),
|
|
83
|
+
analogRead(i2),
|
|
84
|
+
analogRead(i3),
|
|
85
|
+
analogRead(i4),
|
|
86
|
+
analogRead(i5),
|
|
87
|
+
digitalRead(d11),
|
|
88
|
+
digitalRead(d12));
|
|
89
|
+
Serial.println(buffer);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
while ( Serial.available() ) message.process(Serial.read());
|
|
93
|
+
|
|
17
94
|
}
|
data/lib/subduino/store.rb
CHANGED
|
@@ -23,7 +23,7 @@ module Subduino
|
|
|
23
23
|
|
|
24
24
|
def write(k, v, stamp = false)
|
|
25
25
|
return unless redis #.connected?
|
|
26
|
-
stamp ? redis.rpush("
|
|
26
|
+
stamp ? redis.rpush("log:inputs:#{k}", "#{timestamp}:#{v}") : redis.set("now:inputs:"+k, v)
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
|