Giter Club home page Giter Club logo

ottodiy / blockly Goto Github PK

View Code? Open in Web Editor NEW
107.0 15.0 78.0 517.5 MB

Otto Blockly; a fully integrated graphical programming for any type of Arduino projects, including robots, ready to install in your computer, it works offline and also online

Home Page: https://www.ottodiy.com/software

License: GNU General Public License v2.0

JavaScript 5.48% HTML 0.63% NSIS 0.01% C++ 20.51% C 64.07% Makefile 0.01% Shell 0.02% Processing 0.23% Python 8.97% CMake 0.03% CSS 0.07% PowerShell 0.01%
ottodiy robot blockly arduino python microbit ottorobot arduino-ide otto-robot standalone

blockly's Introduction

Otto Ninja Robot Arduino Libraries

License: GPL v3 version

This repository has the main Otto Ninja robot libraries for ESP compatible boards.

Compatible Hardware

  • Designed to work with ESP8266 boards, but most of the code could be adapted to other microcontrollers.

You will need to add the ESP8266 to your Arduino IDE

⭐ Star us on GitHub; it helps!

Installation:

You will need the Arduino IDE on your computer

  1. Download Otto Ninja libraries here
  2. Open the Arduino IDE and navigate to Sketch > Include Library > Add .ZIP Library...
  3. Navigate to .zip file location that you just downloaded and open it.
  4. You will see in the bottom black area a message that it has been installed. 
  5. To verify they are properly installed, go to Sketch > Include Library menu. You should now see the library at the bottom of the drop-down menu.

Example:

You can find codes in File > Examples > OttoNinja.

*For more details or other ways to install libraries, visit this link 

*For the LED matrix, you will need the Adafruit LED Backpack library and all the dependencies just do the exact same installation steps.

*For the OLED display, you will need the U8g2 libraries

Uploading:

For the firmware code to remote control Ninja via the Remote XY mobile App, select NodeMCU 1.0 as the board.

  1. Connect the ESP board using the USB cable to your computer.

  2. Upload this code 

  3. Download the app to your phone

  4. Open the app and press + Add new device.

  5. Select the WiFi point.

  6. Select "OTTO NINJA" from the options.

  7. The password is 12345678.

(Make sure to have wifi disconnected from other networks) and power the robot with a battery all the time.

How to Contribute:

Contributing to this software is warmly welcomed.

  1. Test it, and if you find any problems, then post an issue.
  2. Help us solve the issues or other bugs.
  3. Improve and optimize the current libraries. You can do this basically by forking, committing modifications, and then pull a request

Thanks for your contribution, and welcome to the Otto DIY community

License: CC-BY-SA

You can use all resources of Otto for free, but Otto DIY website must be included in any redistribution, and remixes must keep the CC-BY-SA license. In open source, the idea is that more people can have access; therefore, if you copy or remix Otto, you must also release it under the same open license, which means you must also release all files to the public.

Creative Commons License
Otto DIY by www.ottodiy.com is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Thanks to Sebastian Coddington for this project.

blockly's People

Contributors

automisationchris avatar bodominea avatar chacha75 avatar cparrapa avatar dependabot[bot] avatar ivanr3d avatar jccf07 avatar jdonners avatar kimosaj avatar klaaskuperus avatar ksonone avatar logix5 avatar mahhhuz2 avatar mishafarms avatar mrfusion-jp avatar nca78 avatar neftalivenancio avatar oresztesz-margaritisz-epam avatar pinglunliao avatar prperez25 avatar radzikowski avatar rejas avatar riericksont avatar sfranzyshen avatar slompo avatar takujikawata-pr avatar wendtbw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blockly's Issues

Updating RGB NeoPixel block in LED section with current Adafruit library name

When I create the block *RGB NeoPixel" in the LED block section of blockly, The code blockly creates is using library name <NeoPixel.h> which I think is maybe old?. The new library from github is Adafruit_NeoPixel.h>

PS. I am a bit new but I really want to learn where in the blocky code, how the blocks are created in Blockly and how that block is programmed to create the Arduino code. If its possible just want to know how that process is done in the Blockly code. Thanks so much! My dream is to be able to understand the code better and be able to submit my own pull requests to the otto blockly open source project!

save doesn't work on the Online Web App

I am unable from the web app version to use the save button to save block xml files ... the open button and opening files work fine ... I'm using windows 10 and chrome Version 84.0.4147.89 (Official Build) (64-bit) ... no noticeable warnings or errors appear on the console ... even when the button is pressed ...

Mouth - display variable

I created an int variable and declared it. I added the Mouth block and tried to connect the variable block to it. Instead of showing the number, the led matrix displays the name of the variable.

The variable is storing an integer value. If I use the Pixel X/Y block, I can use the value of the variable to input the X and Y coordinates.

The "S" in the attached image is Otto scrolling the word CLAPS

Otto clap

Some bugs found in version 1.3.0

I installed the new version of Otto Blockly 1.3.0 (OttoBlockly-Setup-1.3.0.exe) but I encountered some bugs:

  • When I click on New, the workspace is only partially cleared.
  • When you change the device on the USB port, the port number does not change.
  • When you drag the Loop block, some elements detach, so you can neither delete nor reconnect them to the original block.

In all cases it is necessary to leave Otto Blockly and re-enter.

Bluetooth connection

Is it possible to connect OttoBlockly to my Otto Humanoid via bluetooth instead of a USB cable?

I want to update the otto blockly

I want to update the otto blocky to add more block with other sensors. My question is simple, because when i download the source code and execute the index.html the blocks of the code don´t appear. The code to show the blocks are the toolboxs folder, but this code i need to know hot to show.

Please let me know thanks

image

Language switch requires page refresh/app restart

@BodoMinea do you also experience that switching between languages, that sometimes does not work immediately? like is necessary to refresh (F5) or even restart the app and therefore deletes all current blocks? maybe we need something more instant or automatically for general users, just a thought.

Similar situation with the setting (Language & Blocks menu) the level sometimes get mixed or showing the categories of other levels instead?

Originally posted by @cparrapa in #7 (comment)

Suggestion to support workshops - capability checklist

In setup, there is currently options for user experience and available blocks.

I think it would be great if there was a section where you list your Otto's capabilities, and that either hides the blocks you can't use, or marks them as unsuitable. Capabilities would include all the variants and common optional hardware - arms, neopixel, distance sensor etc.

As an added advantage, workshop leaders could encourage participants to fill this list in themselves, leading to a more structured exploration of the robot by the user.

Simplfy Check and Upload

The current process of pressing Check, then closing the popup, then pressing Upload, then closing the popup is very annoying when you are making lots of edits.

It would be great if pressing it would do both the check code and upload and then close the popup.
The check code button should remain for users to check without uploading.

This change would match the Arduino IDE user interface.

Add a vision camera for doing IA applications

Hi , My robotic kit use an arduino Leonardo board compatible and i have been creating my own enviroment in Blockly. You can see here. I have added a lot of sensors, actuator, cameras,...

the project in github here

Now I am going to start with otto, and probably migrate your otto blocks to my tool, but in my opinion would be interesting add a camera as Mu Vison to otto by I2C port. Maybe in the next months, i can do it and share here. The camera is easy to integrate using the library and some vision applicaton are available and give to otto an important plus.
Another camera to work is this: https://www.dfrobot.com/product-1922.html maybe more interesting and with panel to see.

I let you know, if at the end add this feature. I am not expert in JavaScript and i would like to create in my tool the option to change the arduino board because the most of blocks are compatible in different pins. Now for otto i will use the nano board.

Thanks

Hello world. I am here. Neo pixels blocky

Ok, what I am trying to do is make Cylon eyes for my new robot. This is my first time here so be easy on me if I come off like a newbie.

I can get the blocks to work somewhat in Otto Blockly. But the problem is two-fold. I may not understand how the blocks should be stacked or used? The second problem is in understanding what parts of the code it writes are available for me to use.
I can get the lights to work in the Arduino code. I just watched a video on how to add // these marks to the code to disable it.
Here is something close to what I am shooting for.
I also tried to add this code to a blocky in otto blockly that says add code here. It just went blank.
I Love blockly and would greatly appreciate any help here. I am not a programmer I am a designer

`#include <Adafruit_NeoPixel.h>
#ifdef AVR
#include <avr/power.h>
#endif

#define PIN 6

// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.

void setup() {
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (AVR_ATtiny85)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
// End of trinket special code

strip.begin();
strip.show(); // Initialize all pixels to 'off'
}

void loop() {
// Some example procedures showing how to display to the pixels:
// colorWipe(strip.Color(255, 0, 0), 50); // Red
//colorWipe(strip.Color(0, 255, 0), 50); // Green
// colorWipe(strip.Color(0, 0, 255), 50); // Blue
//colorWipe(strip.Color(0, 0, 0, 255), 50); // White RGBW
// Send a theater pixel chase in...
//theaterChase(strip.Color(127, 127, 127), 50); // White
theaterChase(strip.Color(127, 0, 0), 50); // Red
//theaterChase(strip.Color(0, 0, 127), 50); // Blue

//rainbow(20);
//rainbowCycle(20);
//theaterChaseRainbow(50);
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}

void rainbow(uint8_t wait) {
uint16_t i, j;

for(j=0; j<256; j++) {
for(i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel((i+j) & 255));
}
strip.show();
delay(wait);
}
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
uint16_t i, j;

for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
for(i=0; i< strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
strip.show();
delay(wait);
}
}

//Theatre-style crawling lights.
void theaterChase(uint32_t c, uint8_t wait) {
for (int j=0; j<10; j++) { //do 10 cycles of chasing
for (int q=0; q < 3; q++) {
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, c); //turn every third pixel on
}
strip.show();

  delay(wait);

  for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
    strip.setPixelColor(i+q, 0);        //turn every third pixel off
  }
}

}
}

//Theatre-style crawling lights with rainbow effect
void theaterChaseRainbow(uint8_t wait) {
for (int j=0; j < 256; j++) { // cycle all 256 colors in the wheel
for (int q=0; q < 3; q++) {
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, Wheel( (i+j) % 255)); //turn every third pixel on
}
strip.show();

  delay(wait);

  for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
    strip.setPixelColor(i+q, 0);        //turn every third pixel off
  }
}

}
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition red - green - blue - back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, 0, 0);
}
WheelPos -= 170;
return strip.Color(WheelPos * 0, 0, 0);
}`

Cannot upload generated code to Arduino Nano with Optiboot (new) bootloader, Arduino Every

Sorry if this is already addressed in some update, I couldn't find one through easy means - automatic update / GitHub.

On the local build of OttoDIY Blockly, obtained through the official website, which is definitely based on this, it is apparently not possible to compile and upload code suited for the new Arduino Nano variants which come with the OptiBoot bootloader. This requires higher code upload speed (BAUD 115200).

This also seems to be causing problems for other people on the forum:

My now open Pull Request #1 aims to solve this problem.

JavaScript Generator Support

I am attempting to combine together OttoDIYESP(LIB) and Elk (a tiny embedded JavaScript engine that implements a small, but usable subset of ES6,) resulting in a JavaScript-able OttoDIY envirnoment. My work is being done for the esp8266 platform because of the arduino nano ram limits ... and would like to use this project as part of the web interface ...

I would like to add javascript code view and output to this blockly project.

I have only glanced over this code ... but I know in the regular blockly javascript (ES5) there is supported so I am hoping anyone who is familiar with this code might be able to point me in the right direction ... using the javascript generators from the regular blockly won't work or would need to be changed to support the limited subset of the Elk javascript interpreter ... so staring from scratch would probably be best ... in my work the OttoDIY API is exposed almost exactly like the C++ Arduino environment within the javascript environment

any blockly guru's want to help me workout the generator stuff within this project ???

my work will start to appear here over the next week ... https://github.com/sfranzyshen/OttoDIY_Elk

Mac version doesn't work on Catalina

I've downloaded the mac version. If I unzip it with the default unarchiver in MacOS it doesn't allow me to run the app. If I unzip with "The Unarchiver" I can start the program, get the expected security stuff. After I allow the app to open the app crashes immediately.
Tried on two different macs.

Error report:Process:               

Blocklino [85542]
Path:                  /Applications/Blocklino.app/Contents/MacOS/Blocklino
Identifier:            com.electron.blocklino
Version:               1.5.0 (1.5.0)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Blocklino [85542]
User ID:               501

Date/Time:             2020-03-13 10:14:52.482 +0100
OS Version:            Mac OS X 10.15.3 (19D76)
Report Version:        12
Bridge OS Version:     3.0 (14Y908)
Anonymous UUID:        0A837EB5-2BDF-8C21-C1C5-4CF871A04AC8

Sleep/Wake UUID:       7768A977-DB68-4529-B50B-B23D03819DA1

Time Awake Since Boot: 230000 seconds
Time Since Wake:       4300 seconds

System Integrity Protection: disabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: @rpath/Electron Framework.framework/Electron Framework
  Referenced from: /Applications/Blocklino.app/Contents/MacOS/Blocklino
  Reason: no suitable image found.  Did find:
	/Applications/Blocklino.app/Contents/MacOS/../Frameworks/Electron Framework.framework/Electron Framework: file too short
	/Applications/Blocklino.app/Contents/MacOS/../Frameworks/Electron Framework.framework/Electron Framework: stat() failed with errno=1

Binary Images:
       0x1077c4000 -        0x1077c4ffb +com.electron.blocklino (1.5.0 - 1.5.0)  /Applications/Blocklino.app/Contents/MacOS/Blocklino
       0x10fcf3000 -        0x10fd83cb7  dyld (733.8)  /usr/lib/dyld
    0x7fff3a0c2000 -     0x7fff3a0c2fff  com.apple.Cocoa (6.11 - 23)  /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
    0x7fff3d6fe000 -     0x7fff3dac6ffc  com.apple.Foundation (6.9 - 1674.114)  /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x7fff3de3e000 -     0x7fff3dee1ffb  com.apple.framework.IOKit (2.0.2 - 1726.80.1)  /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x7fff47690000 -     0x7fff479e2ffa  com.apple.security (7.0 - 59306.80.4)  /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x7fff48832000 -     0x7fff4889cfff  com.apple.SystemConfiguration (1.19 - 1.19)  /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration

Model: MacBookPro13,2, BootROM 264.0.0.0.0, 2 processors, Dual-Core Intel Core i5, 2,9 GHz, 8 GB, SMC 2.37f21
Graphics: kHW_IntelIrisGraphics550Item, Intel Iris Graphics 550, spdisplays_builtin
Memory Module: BANK 0/DIMM0, 4 GB, LPDDR3, 2133 MHz, 0x80CE, 0x4B3445364533303445422D45474347202020
Memory Module: BANK 1/DIMM0, 4 GB, LPDDR3, 2133 MHz, 0x80CE, 0x4B3445364533303445422D45474347202020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x157), Broadcom BCM43xx 1.0 (7.77.106.3 AirPortDriverBrcmNIC-1440.1)
Bluetooth: Version 7.0.3f5, 3 services, 27 devices, 1 incoming serial ports
Network Service: RNDIS/Ethernet Gadget, Ethernet, en9
Network Service: Wi-Fi, AirPort, en0
USB Device: USB 3.0 Bus
USB Device: Apple T1 Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 41.1
Thunderbolt Bus: MacBook Pro, Apple Inc., 41.1

Installation warning by Antivirus

It has been reported many users get similar messages that miss think the software as dangerous

image
image

it - seems not to be a specific signature but the kind of dropping files

You can restore the files from quarantine (after this, they will be ignored from Bitdefender) and got the software running.
But is quite annoying and scary for some people.

Bug in OLED block

I'm just checking out the latest version of Otto Blockly 'Otto Nuevo' and I was having difficulty updating text in the OLED. I used the 'clear OLED' block to wipe the screen before applying the new text, but I'm finding this wasn't working.

To send a command to make some text on the OLED such as 'hi there' there are 2 lines of Arduino code;
display.println("hi there");
display.display();

The arduino code currently called by the 'clear OLED' block is: display.clearDisplay();
but it doesn't work. So when I add a second line 'display.display();' it now works

So the code to clear the display is;

display.clearDisplay();
display.display();

and this works

In addition there is an initialization block for the OLED, and the corresponding block has the code;

display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();

I understand this should also be modified to add 'display.display();' so it becomes;
;
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.display();

I am using arduino Leonardo but I noticed the block is the same on other boards also

Serial Monitor

Hi @BodoMinea

Other challenge is the serial monitor.

It seems now is not really working, i do not know what is missing too, actually i would like just something simple to test sensors input easy for kids. We can even simplify and i can create the necessary remaining blocks

Thanks!

El botón de la boca para dibujar en la matriz LED 8x8 no parece funcionar.

Hola, chicos. Como ya sabéis alguno, estoy trabajando en mi propio proyecto, MasayloBlockly, y he aprendido mucho estudiando este trabajo. El caso es que creo haber descubierto un error en el botón que permite dibujar en la matriz 8x8 que hace de boca (nombre de botón otto9_matrix8x8). Como no domino mucho aún la tecnología GIT, os paso por aquí el código que he modificado en el archivo /www/blocks&generateurs/otto.js a partir de la línea 1256:
`Blockly.Blocks["otto9_matrix8x8"] = { init: function() {
this.appendDummyInput().appendField(' ').appendField(' 0').appendField(' 1').appendField(' 2').appendField(' 3').appendField(' 4').appendField(' 5').appendField(' 6').appendField(' 7');
Blockly.FieldCheckbox.CHECK_CHAR= '▉'
this.appendDummyInput().appendField('0 ')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel0')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel1')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel2')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel3')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel4')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel5')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel6')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel7');
this.appendDummyInput().appendField('1 ')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel8')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel9')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel10')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel11')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel12')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel13')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel14')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel15');
this.appendDummyInput().appendField('2 ')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel16')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel17')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel18')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel19')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel20')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel21')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel22')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel23');
this.appendDummyInput().appendField('3 ')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel24')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel25')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel26')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel27')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel28')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel29')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel30')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel31');
this.appendDummyInput().appendField('4 ')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel32')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel33')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel34')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel35')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel36')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel37')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel38')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel39');
this.appendDummyInput().appendField('5 ')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel40')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel41')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel42')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel43')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel44')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel45')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel46')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel47');
this.appendDummyInput().appendField('6 ')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel48')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel49')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel50')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel51')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel52')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel53')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel54')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel55');
this.appendDummyInput().appendField('7 ')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel56')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel57')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel58')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel59')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel60')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel61')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel62')
.appendField(new Blockly.FieldCheckbox("FALSE"), 'Pixel63');
this.setInputsInline(false);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setColour("#59646f");
this.setTooltip('');
this.setHelpUrl("https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library-use");
},
};
Blockly.Arduino.otto9_matrix8x8 = function() {
Blockly.Arduino.definitions_['otto9_matrix_def'] = '#define DIN_PIN A3\n'

  • '#define CS_PIN A2\n'
  • '#define CLK_PIN A1\n'
  • '#define LED_DIRECTION 1';
    Blockly.Arduino.setups_['otto9_matrix']='Otto.initMATRIX( DIN_PIN, CS_PIN, CLK_PIN, LED_DIRECTION);';
    var code = '';
    for (var i=0; i<64; i++) {

if (this.getFieldValue('Pixel' + i) != 'rgb(255, 255, 255)') {
var on = this.getFieldValue('Pixel' + i)== "TRUE"? "1" : "0";
var row= i +1
{if (i >= 0 && i <= 7)row=0}{if (i >= 8 && i < 16)row=1}{if (i >= 16 && i < 24)row=2}{if (i >= 24 && i < 32)row=3}
{if (i >= 32 && i < 40)row=4}{if (i >= 40 && i < 48)row=5}{if (i >= 48 && i < 56)row=6}{if (i >= 56 && i < 64)row=7}
var col= i
{if (i > 1 && i <= 7)col=i}{if (i >= 8 && i < 16)col=i-8}{if (i >= 16 && i < 24)col=i-16}{if (i >= 24 && i < 32)col=i-24}
{if (i >= 32 && i < 40)col=i-32}{if (i >= 40 && i < 48)col=i-40}{if (i >= 48 && i < 56)col=i-48}{if (i >= 56 && i < 64)col=i-56}
code += ' Otto.setLed('+row+','+col+',' + on + ');\n'
}
};
for (var i=0; i<8; i++) {if (this.getFieldValue('eyes_pixel' + i) == 'TRUE')row = 0;};
return code;
};
`

Mac, Linux and Windows installers in the Releases section of github

At the moment if you need to download the latest installer version you have to click / go through these three links

--> https://www.ottodiy.com/#blockly
--> https://uploads.strikinglycdn.com/files/6c9116e7-80ff-4288-917b-831c4b8d01d5/Otto%20Blockly%20download.pdf
--> link from drive

My porposal is to host the releases on github (in the releases section), in this way people would easily see the version they are installing and the link would be easily tracked and shared (other than Google Drive)

Italian translation

I would like to know whether the Italian translation is in progress, otherwise I could start working on it.

Mac OS installer

So I have been trying really hard to build from my Windows computer using electron, the Mac and linux versions, unfortunately the application that is generated doesn't open or is just white.

My dream will be to make it also for raspberry pi so that we could make everything with opensource hardware!

There must be a way since electron.is is supposed to be a multi platform development environment for almost all OS.

Alternatively we could "just " find a way to make the arduino uploader work for this online app, for chrome books used in schools this will be amazing. Before in other blockly arduino repos, online uploading was working with codebender.cc but it seems is no longer available or more of a private project not sure. Maybe we could upload via Bluetooth using .hex files will be even easier than USB drivers ?

I don't know, just brainstorming @BodoMinea 😄 putting in common the major challenge to make this software really available to anyone.

You have solve the other issues, so fast, impressive👏so happy to have your support, thanks a lot from all the community, I am pretty sure they are happy too.

Have a good weekend.

Disconnected blocks

Hi. On the idea that all blocks run, even if not connected to a trigger... Our intent in using Blockly is to teach computational thinking. As such, the output behaviour of the system should be consistent with standard coding practices, otherwise we allow / encourage / reinforce poor thinking and practice. I think it is essential that disconnected blocks do NOT run. If we want to make it easier for our users, it would be better if the “check the code” button (and its runtime during “upload to robot”) post a message saying “You have one or more unconnected blocks. These cannot run. Either connect the block, or right click and disable it”.

Error función getdistance

Realizando pruebas en la versión online de blocky, me encontré que la función por defecto del sensor ultrasónico me devuelve valores como si no encontrará la función específica, caso contrario generando el objeto y especificandole en que pines de encuentra el sensor de forma manual la lectura es totalmente correcta, he estado revisando las librerías de Otto que me arrojan dependencia pero no logro encontrar donde se ejecuta el cálculo exactamente.

Adding Arduino code to Otto blockly so the two work as one.

I think it would be very helpful to figure out a block or make a block that you can copy and paste the Arduino code into that will work alongside the other blocks in blockly. Imagine how powerful this will make Otto blockly not only can you run code but you can add blocks to the code that was used for an example in Ardunio. Here would be a small example. You want your project to use the blockly servos, the blockly loops, timing, led mouth, and leg calibration. Now you also want to add some OLEDs and new pixels from a code somebody else wrote on Github or youtube. If all you had to do was paste that code into the program using a block and it would automatically write into the code that is there from the blocks you used

Release type

OttoBlockly doesn't need a proper installation, so I suggest releasing a zipped version as well.
Normally I unzip the .exe file with 7zip and copy only the files contained in app-32.7z.

Humanoid examples - error when checking code

The Humanoid examples in 1.4.0 don't work - big block of red error text. It is only the blocks for arms that don't work. Code is

Error: Command failed: arduino-cli.exe compile --fqbn arduino:avr:nano:cpu=atmega328old sketch/sketch.ino C:\OttoBlockly\compilation\arduino\sketch\sketch.ino: In function 'void setup()': C:\OttoBlockly\compilation\arduino\sketch\sketch.ino:39:13: error: 'PIN_AR' was not declared in this scope AL.attach(PIN_AR); ^~~~~~ C:\OttoBlockly\compilation\arduino\sketch\sketch.ino:39:13: note: suggested alternative: 'PIN_RR' AL.attach(PIN_AR); ^~~~~~ PIN_RR C:\OttoBlockly\compilation\arduino\sketch\sketch.ino:40:11: error: 'PIN_AL' was not declared in this scope AR.attach(PIN_AL); ^~~~~~ C:\OttoBlockly\compilation\arduino\sketch\sketch.ino:40:11: note: suggested alternative: 'PIN_RL' AR.attach(PIN_AL); ^~~~~~ PIN_RL C:\OttoBlockly\compilation\arduino\sketch\sketch.ino:41:1: error: 'move_servo' was not declared in this scope move_servo(); ^~~~~~~~~~ C:\OttoBlockly\compilation\arduino\sketch\sketch.ino: In function 'void loop()': C:\OttoBlockly\compilation\arduino\sketch\sketch.ino:56:80: error: 'move_servo' was not declared in this scope for(int angle=90; angle<90+shift; angle+=shift_inc){ pos[2] = angle; move_servo(); delay(shift_delay);} ^~~~~~~~~~ C:\OttoBlockly\compilation\arduino\sketch\sketch.ino:57:84: error: 'move_servo' was not declared in this scope for(int angle=90+shift; angle>90-shift; angle-=shift_inc) { pos[2] = angle; move_servo(); delay(shift_delay); } ^~~~~~~~~~ C:\OttoBlockly\compilation\arduino\sketch\sketch.ino:58:77: error: 'move_servo' was not declared in this scope for(int angle=90-shift; angle<90; angle+=shift_inc) {pos[2] = angle; move_servo(); delay(shift_delay); } ^~~~~~~~~~ Error during build: exit status 1

Driver install failure of CH341SER.INF

Hi all,

As suggested in the readme, I downloaded the latest version of otto blocky and installed OttoBlockly-Setup-1.2.0.exe and also tried OttoBlockly-1.2.0.exe in a windowsX64 machine. However none of them recognise the USB device. So I am trying to execute SETUP.exe downloaded from the suggested path: pilotes/_CH341 which results in the following installation failure:

Capture

I might be missing something. I am wondering if you any recommendations?

Zoom to fit doesn't work

When I press the = button to zoom to fit, the workspace zooms to alomst the right size, but part of the blocks are still off-screen

Auto Updater

Hi @BodoMinea

It seems you are much better at code than me so i am just gonna put some challenges as issues, that i faced while developing this to solve, if you maybe know the solution or at least the way to do it, it will be greatly appreciated:

It seems the auto update is still linked to the forked project and is creating some confusion in users, i tried by changing name inside the packgage.json but i must be missing something because it was bad built. It must be connected to having links in other files.

Thanks!

Using arduino_web_server for web version of otto blockly in Ubuntu 18.04x64

Dear @cparrapa et al.

Related to #38, one potential solution might be the use of the web version of Otto blockly by running a python arduino_web_server. That said, I made a PR#116 adding few instructions on the use of BlocklyDuino in Ubuntu 18.04x64. Then, it is just came to my mind the idea of trying such similar approach as shown below

Screenshot from 2020-08-15 22-54-02

However, I am a bit stuck here when trying to related the upload functions of both blocklyduino/index.html and /www/index.html:
https://github.com/BlocklyDuino/BlocklyDuino/blob/gh-pages/blockly/apps/blocklyduino/index.html#L300

              <button type="button" onclick="uploadClick()">Upload</button>

https://github.com/OttoDIY/blockly/blob/master/www/index.html#L131

		<button id="btn_flash" class='btn btn-arduino' data-toggle="modal" data-target="#message">
			<span class="fa fa-arrow-right fa-1_5x fa-fw"> </span>
		</button>

What do you think? Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.