Skip to content

Commit

Permalink
Merge branch 'release-2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gregcorbett committed Sep 24, 2017
2 parents 085f09d + aa42289 commit 64d07a3
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 18 deletions.
8 changes: 8 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Changelog

========== Version 2.1.0 ==========

Minor Changes:
- Add Digital and Analog Hall Sensors

Patches and Bug Fixes:
- Standardize `pinMode(#, OUTPUT)` formatting

========== Version 2.0.2 ==========

Patches and Bug Fixes:
Expand Down
File renamed without changes.
26 changes: 13 additions & 13 deletions README.markdown → README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#ArduBlock
# ArduBlock


ArduBlock is a Block Programming Language for Arduino. The language and functions model closely to [Arduino Language Reference](http://arduino.cc/en/Reference/HomePage)

##Users
## Users
Ardublock is a free graphical programming environment to make programming physical computing with Arduino as easy as drag and drop. It is based on the popular ‘scratch’ programming language, which many will already be familiar with. Ardublock generates code in C, a text based language used by the Arduino IDE, which can then be studied and modified if desired.

Ardublock is an extension to the Arduino IDE so that will need to be downloaded as well (found here https://www.arduino.cc/en/Main/Software).
* Ardublock is tested with version 1.8.2, available here: https://www.arduino.cc/download_handler.php?f=/arduino-1.8.2-windows.exe
* Ardublock is tested with version 1.8.4, available here: https://www.arduino.cc/download_handler.php?f=/arduino-1.8.4-windows.exe

Code written in Ardublock has the file extension .abp.

####Getting Started with ArduBlock
#### Getting Started with ArduBlock
1. Install the Arduino IDE, from https://www.arduino.cc/en/Main/Software
2. Download ardublock-all.jar https://github.com/stfc/ardublock/releases/latest
3. Copy ardublock-all.jar to C:/Users/<username>/Arduino/tools/ArduBlockTool/tool/ardublock-all.jar under
Expand All @@ -20,19 +20,19 @@ Code written in Ardublock has the file extension .abp.
* In Linux, /home/<username>/sketchbook/tools/ArduBlockTool/tool/ardublock-all.jar
4. Start the Arduino IDE and find ArduBlock under the Tool menu

##Developers
If you wish to develop ardublock, follow the instructions below. A prerequsite is openblocks, which can be found here https://github.com/gregcorbett/openblocks/archive/v1.0.zip
###Installation
## Developers
If you wish to develop ardublock, follow the instructions below. A prerequsite is openblocks, which can be found here https://github.com/gregcorbett/openblocks
### Installation

The project is managed by Maven. After checking out the source for the first time, one should run the following to install Arduino's pde.jar into the local repository.

$ mvn validate

###Usage
### Usage

$ mvn exec:java -Dexec.mainClass="com.ardublock.Main"

###Development
### Development

Change the /src/main/resources/com/ardublock/block/ardublock_def.xml to add new blocks to ArduBlock

Expand All @@ -42,15 +42,15 @@ Change the /src/main/resources/com/ardublock/block/ardublock_def.xml to add new

The Visual Block environment should show up. Happy Hacking! ;)

###Deploy
### Deploy

Edit code of ardublock

$ mvn clean package

copy the target/ardublock-all.jar to Arduino\tools\ArduBlockTool\tool

##Authors
## Authors

The original code (https://github.com/taweili/ardublock) was developed at MIT and the authors can be contacted below.

Expand All @@ -59,7 +59,7 @@ The original code (https://github.com/taweili/ardublock) was developed at MIT an

The author/maintainer of this fork can be contacted at [email protected].

##License
## License
Copyright (C) 2011 David Li and He Qichen

This file is part of ArduBlock.
Expand All @@ -75,4 +75,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ArduBlock. If not, see <http://www.gnu.org/licenses/>.
along with ArduBlock. If not, see <http://www.gnu.org/licenses/>.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>org.ardublock</groupId>
<artifactId>ardublock</artifactId>
<packaging>jar</packaging>
<version>2.0.2-SNAPSHOT</version>
<version>2.1.0-SNAPSHOT</version>
<name>ArduBlock</name>
<description>A Block Programming Language for Arduino</description>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public String toCode() throws SocketNullException, SubroutineNotDeclaredExceptio
ret = ret + outputPin;
ret = ret + ", ";

translator.addSetupCommand("pinMode(" + outputPin + ", OUTPUT);");
translator.addSetupCommand("pinMode( " + outputPin + ", OUTPUT);");
translatorBlock = this.getRequiredTranslatorBlockAtSocket(1);
ret = ret + translatorBlock.toCode();
ret = ret + ");\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public String toCode() throws SocketNullException, SubroutineNotDeclaredExceptio

if (translatorBlock instanceof NumberBlock)
{
String setupCode = "pinMode( " + number + " , OUTPUT);";
String setupCode = "pinMode( " + number + ", OUTPUT);";
translator.addSetupCommand(setupCode);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.ardublock.translator.Translator;

public class TinkerHallBlock extends AbstractTinkerReadAnalogBlock
public class TinkerHallBlock extends AbstractTinkerReadDigitalBlock
{
public TinkerHallBlock(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.ardublock.translator.block.tinker;

import com.ardublock.translator.Translator;

public class TinkerHallBlockAnalog extends AbstractTinkerReadAnalogBlock
{
public TinkerHallBlockAnalog(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label)
{
super(blockId, translator, codePrefix, codeSuffix, label);
}

}
4 changes: 3 additions & 1 deletion src/main/resources/com/ardublock/block/ardublock.properties
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ bg.df_lcd_keypad=DFRobot LCD Keypad
bg.Tinker_Accmeter=Accelerometer
bg.Tinker_Button=Button
bg.Tinker_Hall=Hall
bg.Tinker_Hall_Analog=Hall Analog
bg.Tinker_I0=I0
bg.Tinker_I1=I1
bg.Tinker_I2=I2
Expand Down Expand Up @@ -437,7 +438,7 @@ ardublock.ui.create_refer=create reference
ardublock.ui.website=Go to Web Site
ardublock.ui.serialMonitor=Serial Monitor
ardublock.ui.saveImage=Save as image...
ardublock.ui.version=2.0.2
ardublock.ui.version=2.1.0

ardublock.error_msg.digital_var_slot=Digital variable slot must take a 'digital variable' name.\nHint: Look at the 'variable' socket on the highlighted block
ardublock.error_msg.number_var_slot=Standard variable slot must take a standard 'numeric' variable name.\nHint: Look at the 'variable' socket on the highlighted block
Expand Down Expand Up @@ -625,6 +626,7 @@ bg.Tinker_Servo.description=TinkerKit Servo
bg.Tinker_Button.description=TinkerKit Button
bg.Tinker_Accmeter.description=TinkerKit Accelerometer
bg.Tinker_Hall.description=TinkerKit Hall Sensor
bg.Tinker_Hall_Analog.description=TinkerKit Analog Hall Sensor
bg.Tinker_LDR.description=TinkerKit LDR
bg.Tinker_LinearPotentiometer.description=TinkerKit Accelerometer
bg.Tinker_RotaryPotentiometer.description=TinkerKit RotaryPotentiometer
Expand Down
38 changes: 38 additions & 0 deletions src/main/resources/com/ardublock/block/ardublock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2481,6 +2481,42 @@
</Image>
</Images>
</BlockGenus>

<BlockGenus name="Tinker_Hall" kind="data" color="255 255 255" initlabel="bg.Tinker_Hall">
<description>
<text>TinkerKit Hall Sensor</text>
</description>
<BlockConnectors>
<BlockConnector connector-type="boolean" connector-kind="plug" />
<BlockConnector connector-type="number" connector-kind="socket" label="bc.pin_number">
<DefaultArg genus-name="number" label="2" />
</BlockConnector>
</BlockConnectors>
<Images>
<Image>
<FileLocation>com/ardublock/block/arduino/Tinker_Hall.png</FileLocation>
</Image>
</Images>
</BlockGenus>

<BlockGenus name="Tinker_Hall_Analog" kind="data" color="255 255 255" initlabel="bg.Tinker_Hall">
<description>
<text>TinkerKit Hall Sensor</text>
</description>
<BlockConnectors>
<BlockConnector connector-type="number" connector-kind="bc.num" />
<BlockConnector connector-type="number" connector-kind="socket" label="bc.pin_number">
<DefaultArg genus-name="number" label="2" />
</BlockConnector>
</BlockConnectors>
<Images>
<Image>
<FileLocation>com/ardublock/block/arduino/Tinker_Hall_Analog.png</FileLocation>
</Image>
</Images>
</BlockGenus>


<BlockGenus name="Tinker_I0" kind="data" color="255 255 255" initlabel="bg.Tinker_I0" editable-label="no">
<BlockConnectors>
<BlockConnector connector-type="number" connector-kind="plug" position-type="mirror" />
Expand Down Expand Up @@ -9213,6 +9249,8 @@
<BlockGenusMember>Tinker_LDR</BlockGenusMember>
<BlockGenusMember>Tinker_Tilt</BlockGenusMember>
<BlockGenusMember>df_temperature_sensor</BlockGenusMember>
<BlockGenusMember>Tinker_Hall</BlockGenusMember>
<BlockGenusMember>Tinker_Hall_Analog</BlockGenusMember>
</BlockDrawer>
<BlockDrawer button-color="55 155 255" name="bd.Fairebot" type="factory">
<BlockGenusMember>FaireBot_Forward</BlockGenusMember>
Expand Down
Binary file modified src/main/resources/com/ardublock/block/arduino/Tinker_Hall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ Tinker_Relay=com.ardublock.translator.block.tinker.TinkerRelayBlock
Tinker_Button=com.ardublock.translator.block.tinker.TinkerButtonBlock
Tinker_Accmeter=com.ardublock.translator.block.tinker.TinkerAccmeterBlock
Tinker_Hall=com.ardublock.translator.block.tinker.TinkerHallBlock
Tinker_Hall_Analog=com.ardublock.translator.block.tinker.TinkerHallBlockAnalog
Tinker_LDR=com.ardublock.translator.block.tinker.TinkerLDRBlock
Tinker_LinearPotentiometer=com.ardublock.translator.block.tinker.TinkerLinearPotentiometerBlock
Tinker_RotaryPotentiometer=com.ardublock.translator.block.tinker.TinkerRotaryPotentiometerBlock
Expand Down

0 comments on commit 64d07a3

Please sign in to comment.