taweili / ardublock Goto Github PK
View Code? Open in Web Editor NEWArduBlock is a Block Programming Language for Arduino.
License: GNU General Public License v3.0
ArduBlock is a Block Programming Language for Arduino.
License: GNU General Public License v3.0
Is there a way to print a TAB character? Placing a \t inside the the Serial.print block results in a Serial.print("\t");
'Write to EEPROM' block generates code with max 'data' value of 128.
This should be 255 as each address ia a whole byte.
The screen size can be too small for large program.
Hi,
could it be possible to add an "Save as"-Button? - If you are programming, you will normally load an old program and you will modify it. If you have a "Save as"-Button, you can do it. Now, you have to copy the programm with your filemanager, you can't do it with Ardublock. That's inconvenient... ;-(
Properly add pinMode code in setup() for the source.
.png gives better output – especially around text.
Much more professional looking.
Once a comment is added to the block, it can't be deleted.
I can't find a way to turn off block connectors normal behaviour of 'able to be dragged away', I think that would be a good way of setting parameters in a block that just don't make sense anywhere else.Something that will increasingly crop up as more hardware support is added?
Would it be possible to have this feature? Have I missed something? Or is there a better way to do what I want?
Here's why, just for now...
I've been changing the "Servo" block so that it copes better with the actual servos we're using (they all need extra parameters in the call to 'attach' to get anything like 180 degree rotation from them). It looks like this.
I've used 'string-list' for the top connector to stop garbage being attached but it can still be dragged away and discarded - and I then have to provide a way of putting it back which takes up room in the 'Draw' and shouldn't really be needed.
Probably the same arguement for the middle connector as well.
If you move the blocks around - and drag past the edge of the window, the blocks become un-attached.
The image attached shows the blocks - they're still "attached" to the main set digital pin block - but they're not near it? If I do a "organize all blocks" it re-fixes the number and boolean blocks back.
Blocks in the setup() are not being properly parsed? If I put the following:
the code that's generated looks like this:
void setup()
{
pinMode( 5 , OUTPUT);
digitalWrite( 5 , HIGH );
delay( 1000 );
digitalWrite( 5 , LOW );
}
Okay - maybe it's not a big deal that the second delay is missing? but, it gets worse. This:
should blink twice, right? but, the generated code still looks like:
void setup()
{
pinMode( 5 , OUTPUT);
digitalWrite( 5 , HIGH );
delay( 1000 );
digitalWrite( 5 , LOW );
}
This was tested with the latest release
This problem does not appear to be an issue with the 1006 release.
When I try and open a second sketch (.ino NOT an .abp), I'm getting a stack heap error when ardublock v20131031 is installed as a tool. (Windows 8.1) Not sure if the problem is a memory leak with ardublock, or the allocated memory in configuration.txt needs to be increased. Problem goes away if I rename the tools directory (holding ardublock) to "fubar-tools"
Here's an example error.
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at javax.swing.JScrollPane.createViewport(Unknown Source)
at javax.swing.JScrollPane.(Unknown Source)
at edu.mit.blocks.codeblockutil.CTracklessScrollPane$1.(CTracklessScrollPane.java:146)
at edu.mit.blocks.codeblockutil.CTracklessScrollPane.(CTracklessScrollPane.java:148)
at edu.mit.blocks.codeblockutil.CPopupMenu.(CPopupMenu.java:41)
at edu.mit.blocks.codeblockutil.LabelWidget$LabelMenu.(LabelWidget.java:511)
at edu.mit.blocks.codeblockutil.LabelWidget$LabelMenu.(LabelWidget.java:506)
at edu.mit.blocks.codeblockutil.LabelWidget.(LabelWidget.java:52)
at edu.mit.blocks.renderable.BlockLabel$1.(BlockLabel.java:81)
at edu.mit.blocks.renderable.BlockLabel.(BlockLabel.java:81)
at edu.mit.blocks.renderable.SocketLabel.(SocketLabel.java:15)
at edu.mit.blocks.renderable.RenderableBlock.synchronizeSockets(RenderableBlock.java:544)
at edu.mit.blocks.renderable.RenderableBlock.(RenderableBlock.java:249)
at edu.mit.blocks.renderable.RenderableBlock.(RenderableBlock.java:186)
at edu.mit.blocks.renderable.FactoryRenderableBlock.(FactoryRenderableBlock.java:40)
at edu.mit.blocks.workspace.PageDrawerLoadingUtils.loadBlockDrawerSets(PageDrawerLoadingUtils.java:236)
at edu.mit.blocks.workspace.Workspace.loadWorkspaceFrom(Workspace.java:849)
at edu.mit.blocks.controller.WorkspaceController.loadFreshWorkspace(WorkspaceController.java:397)
at com.ardublock.core.Context.resetWorksapce(Context.java:110)
at com.ardublock.core.Context.(Context.java:76)
at com.ardublock.core.Context.getContext(Context.java:63)
at com.ardublock.ui.OpenblocksFrame.(OpenblocksFrame.java:71)
at com.ardublock.ui.ArduBlockToolFrame.(ArduBlockToolFrame.java:3)
at com.ardublock.ArduBlockTool.init(ArduBlockTool.java:28)
at processing.app.Editor.addTools(Editor.java:824)
at processing.app.Editor.buildToolsMenu(Editor.java:693)
at processing.app.Editor.buildMenuBar(Editor.java:486)
at processing.app.Editor.(Editor.java:212)
at processing.app.Base.handleOpen(Base.java:846)
at processing.app.Base.handleOpen(Base.java:811)
at processing.app.Base$8.actionPerformed(Base.java:1604)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
注释功能蛮好,可惜不能中文
The Chines version doesn't show up font in the block. Probably a font problem.
Also it's a bit confusing to say that you are repeating the commands for "times"
Maybe it should be something like: "Repeat the commands for n times" with variable assigned to the count.
Our test group found this to be a bit confusing of a command structure - more testing needs to be done on how this block will be used.
Out of my own carelessness, I accidentally switched the variable name and the assignment value with the "set digital var" and "set number var" commands.
When you do this with the set number var the error comes back:
"digital var must be digital var"
if you do this with the "set digital var" block, you get the error:
"var must be var"
if you do this with the create array command - it bonks, but doesn't tell you...
If you have anything with a math or a logical operator and try to clone it - the number variable \ value field doesn't refresh to fit the contents. This can get really messy - as we saw with some students' projects last week as they were trying to add some pretty awesome capability to their programs.
millis() returns an 'unsigned long' but these aren't available in the 'variables' draw.
Unless there's something I missed?
pull request to fix this available.
(Sorry if I’m getting the etiquette of this wrong – just starting out – happy to be corrected)
One of the benefits of Ardublock and all the other scratch-like environment is the ease and clarity of the solution that can be expressed by them.
Creating multiple loop blocks would be the obvious approach by anyone who is not aware of the underlying implementation of (Arduino setup()/loop() pair).
Has any one you considered incorporating one of the available Arduino threading libraries (I can see several here: http://playground.arduino.cc//Main/LibraryList#Sched , not including full RTOS as those mentioned here: http://forum.arduino.cc/index.php?topic=91181.0).
I think a simple cooperative multitasking scheme can be created by detecting each delay() call within a loop, and separating the loop into multiple function, with each part, separated by delay() calls the next function in the sequence using the thread scheduler and the desired delay.
Multiple loops can then be supported by having the main loop schedule all loops defined.
Has anyone ever considered adding this?
I've tried translating ArduBlock to Hebrew.
After translating a small portion (14%) of the files, I've tried to test my translations as explained in the block entry:
http://blog.ardublock.com/2013/08/16/how-to-test-translations-locally/
Unfortunately, following the instructions didn't show any sign that the translation files were picked up.
I created the required com/ardublock/block/ardublock_he.properties file, ran it using:
java -Duser.language=he -cp .:ardublock-all.jar com.ardublock.Main
but it there were no apparent changes in the ardublock run.
I also tried:
I got my translation file directly from crowdin, as explained in the blog.
Could add switch case block in ArduBlock? thanks.
Change compile target to 1.5 instead of 1.6.
There are some errors on some blocks for the translation :
TinkerKit library: https://github.com/TinketKit/TinkerKit
需要支持I0...5, O0...5, 在使用TinkerKit的blocks的时候,#include "TinkerKit.h" 以防他们未来改变。另外,增加个I0...I5和O0...O5的blocks这样用TinkerKit的时候就直接使用I/O而不是Arduino的pin number.
Making it easier to save program as image for publication.
pull request available for this if needed.
(Sorry if I’m getting the etiquette of this wrong – just starting out – happy to be corrected)
From Byron,
Mike McCauley wrote a library that encapsulates serial commands to the Roomba. ( http://www.open.com.au/mikem/arduino/Roomba/index.html ) The library wraps a serial protocol with higher level functions. It runs on Arduino. The header file has a nice description of the functions: http://www.open.com.au/mikem/arduino/Roomba/Roomba_8h-source.html
It was my intent to further wrap this class with an even higher level class to make it easier to use from Ardublocks- so that you could specify blocks like left/right, etc...
Proper description for each blocks.
"I2C Write" and "I2C Read" are both capitalized but then "I2C read ok?" is not. I think it should all be lowe-case?
Also - under Storage --> Read and Write EEPROM and Address Data and File should also be lower-case
BLE_Shield --> "Data Available" should be "data available"
Support of definition of Constant block
First, I have to say: great job on ArduBlock! I was able to get it running in no time and everything works.
I'm using an Arduino Uno with TinkerKit, and I noticed that the code ArduBlock generates for TinkerKit blocks is not "real" TinkerKit code. It uses the constants like "O1", "I1", etc but it doesn't use the TinkerKit objects and methods like "TKButton.pressed()". Instead, the generated code is "analogRead(I1)>512?true:false". I took a quick look at the source and it seems this should be pretty easy to improve, but I can't be sure without more investigation.
'Write to Sd' generates code that creates "dataFile" but then refers to "datafile" with lower case 'f'.
File dataFile = SD.open("gh.txt", FILE_WRITE);
if(datafile){
datafile.print( "Message" );
datafile.print(" ");
datafile.println("");
datafile.close();
}
Hi,
there is a pb with the block "/", it appears like "A." ... maybe the traduction ?
建议看看miniblog软件,吸取他们的优点
你比如我现在要引用变量,我可以从我已经定义的变量中找
现在ArduBlock必须重新输变量
code generated like this
!( Serial.print( digitalRead( 1) );
Array blocks will be handy.
Max/Min block generates MAX(1,5) as max(15). A comma is missing.
The file is saved in native encoding instead of UTF8 and can't be loaded.
新的OpenBlocks已经把Workspace独立出来了,我把一些代码改了,基本上编译过,可以执行,但是还没有详细检查输出的部分。新的openblocks里面把Workspace独立出来了,现在一个程序里面可以有好几个Workspace了,你的Translator的架构我稍微改了一下,传了workspace。另外比之前用的Block.getBlock(blockId)已经没有了,这个该在workspace.getEnv().getBlock(blockId).
We really need copy and paste...
(1) Blocks for EEPROM.write and EEPROM.read only work correctly with constants – not variables, math operations, etc. AFAICT. I have a fix for this if needed
(2) I’d really like EEPROM blocks to normally read/write ‘int’s, rather than ‘byte’s, as much else just assumes ‘int’s.
(3) Blocks to read/write unsigned longs would be useful too i.e. recording times from millis()
Is it OK to work on (2) or (3)?
Note::Please close/reject my previous issue "'EEPROM.write' max value for 'data' is wrong" as that one is pointless
<Typeblocking> enabled="true"</Typeblocking>
I'm new here, perhaps it's been tried before and failed?
Seems quite useful if it's not buggy.
Hey guys, amazing work you are doing. I was just curious and obviously driven by the attractive graphic interface you've got.
My setup is OSX 10.5.8 and it crashes when I launch Arduino (1.5 I think )
The log says " java.lang.NoClassDefFoundError: javax/swing/filechooser/FileNameExtensionFilter
May be my Arduino is not 100% standard or my Java version is not what .jar was expecting. .. any clues?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.