Skip to content

Commit

Permalink
fix issues #167 #168 #171 and new examples
Browse files Browse the repository at this point in the history
  • Loading branch information
cparrapa committed Sep 27, 2022
1 parent 20639cf commit 03860be
Show file tree
Hide file tree
Showing 14 changed files with 3,040 additions and 23 deletions.
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is a free and open source visual programming language based on Blockly from Google & MIT, to generate C/C++ code,
compile and upload to multiple options of microcontrollers. Compatible with any
[Otto DIY robot, Arduino oe ESP8266 and ESP32 related boards](https://www.ottodiy.com/software). It is the perfect
[Otto DIY robot, Arduino or ESP8266 and ESP32 related boards](https://www.ottodiy.com/software). It is the perfect
software to get you started into coding and STEM robotics.

## [Click here to watch the video to see all the main features](https://youtu.be/chcWxh4Co_c)
Expand All @@ -11,21 +11,17 @@ software to get you started into coding and STEM robotics.
This software can work offline (standalone) by installing it on your computer. Depending on your operating system the
installation files are already available or you have to create them yourself.

### Windows
### Windows and MacOS

Download the installer from the [releases page](https://github.com/OttoDIY/blockly/releases). After the software is
installed in your PC, it is ready to use immediately, you do not need to import Arduino libraries or any additional
swtup for the boards because it comes with a copy of the Arduino CLI, it is all in one software!, you will be ready
setup for the boards because it comes with a copy of the Arduino CLI, it is all in one software!, you will be ready
to upload codes directly to your robot or any other Arduino project via USB.

If your computer do not recognize the USB device or Otto, you have to install the CH340 or CH341 or FTDI driver that
is in the ["driversUSB" folder](https://github.com/OttoDIY/blockly/tree/master/driversUSB) or download from
[this link](https://sparks.gogo.co.nz/ch340.html)

### MacOS

TODO

### Linux

For Linux operating systems go to [this repo](https://github.com/OttoDIY/blocklyLinux).
Expand All @@ -34,13 +30,11 @@ For Linux operating systems go to [this repo](https://github.com/OttoDIY/blockly

1. Open any example.
2. Connect your Otto robot.
3. Select Arduino nano and the USB port where Otto is connected.
3. Select your board and the USB port where Otto is connected.
4. Upload and yes is that easy you can even just click upload and the code will be automatically compiled!

Drag, drop, connect, mix, play and create your own codes. [Join the Otto Builder community, see all the cool stuff we are making with Otto Blockly and post your ideas!](http://builders.ottodiy.com/)

[## Support us by buying our awesome STEM robot kits](http://store.ottodiy.com/)

## Help us add new Languages

Leave your mark in the world by translating Blockly, you are welcome to contribute with any languages you know, it will
Expand All @@ -50,12 +44,12 @@ The more people helping to translate the better, it is important to translate wh
is the robot actually doing to be accurate.

1. Go to the [lang folder](https://github.com/OttoDIY/blockly/tree/master/www/lang) and duplicate the Arduino_en.js
Blockly_en.js and msg_en.js files from english
Blockly_en.js and msg_en.js files from English
2. Rename them according to your ISO language code, for example fr is for French, so the files are renamed like this:
Arduino_fr.js Blockly_fr.js and msg_fr.js
3. Edit the files with any code editor software like [Visual Studio Code](https://code.visualstudio.com/) translating
only the english part after = in between the quotes "" in visual studio is the text in red.
4. Then open a pullrequest [here in github](https://github.com/OttoDIY/blockly/pulls) or just attach the files in a
only the English part after = in between the quotes "" in visual studio is the text in red.
4. Then open a pull request [here in github](https://github.com/OttoDIY/blockly/pulls) or just attach the files in a
[new issue](https://github.com/OttoDIY/blockly/issues).

## How to run project
Expand All @@ -70,7 +64,7 @@ You will need to have installed the node.js tools in your computer. The version
>npm install -g windows-build-tool
(this command is not working ok. If the log is held then you must install python 2.7 before because the problem is with the python installation.)
> npm install -g node-gyp
4. Install required node modules.Execute following on the source code directory
4. Install required node modules. Execute following on the source code directory
> npm install
5. Install Arduino CLI
get arduino-cli.exe from https://github.com/arduino/arduino-cli/releases
Expand Down Expand Up @@ -129,6 +123,7 @@ Thanks to all these great people and open projects, it has been possible to make
- [Bodo Minea](https://github.com/BodoMinea)
- [Takuji Kawata](https://github.com/takujikawata-pr)
- [Nicolas Nca78](https://github.com/Nca78/Matrix_GFX)
- [Iván R.](https://github.com/IvanR3D)
- [Node.js](https://nodejs.org/)
- [Bootstrap](http://getbootstrap.com)
- [Font Awesome](http://fontawesome.io)
Expand Down
2 changes: 1 addition & 1 deletion www/blocs&generateurs/actionneur.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Blockly.Arduino["play"]=function(block){
var value_pin=Blockly.Arduino.valueToCode(block, "PIN", Blockly.Arduino.ORDER_ATOMIC);
var value_note=block.getFieldValue("note");
var value_tempo=block.getFieldValue("tempo");
Blockly.Arduino.setups_["setup_output"]="pinMode( "+value_pin+" , OUTPUT);";
Blockly.Arduino.setups_["setup_output" + value_pin]="pinMode( "+value_pin+" , OUTPUT);";
return "tone( "+value_pin+"," + value_note + "," + value_tempo + ");\n delay(" + value_tempo + ");\n"
};
Blockly.Python["play"]=function(block){
Expand Down
2 changes: 1 addition & 1 deletion www/blocs&generateurs/motor.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ Blockly.Blocks['servo_2wheels_init'] = { init: function() {
+ 'int leftSpeed = 0;\n'
+ 'void motorControl(int rightSpeed, int leftSpeed, int stepDelay) {\n'
+ 'rightServo.write(90 + rightSpeed); leftServo.write(90 - leftSpeed);\n'
+ 'delay(stepDelay*1000);}';
+ 'delay(stepDelay*1000);rightServo.write(90);leftServo.write(90);}';
Blockly.Arduino.setups_['otto9_initw']='rightServo.write(90);\n'
+'leftServo.write(90);\n'
+'delay(1000);\n'
Expand Down
16 changes: 11 additions & 5 deletions www/examples/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
{"source_url": "matrixeyestest.xml","source_text": "👨‍💻Level 2 | 👀 16x8 LED eyes matrix test |","visible": true },
{"source_url": "matrixeyes.xml","source_text": "👨‍💻Level 2 | 👀 16x8 LED eyes matrix emotions |","visible": true},
{"source_url": "eyesall.xml","source_text": "👨‍💻Level 2 | 👀 Otto eyes all emotions |","visible": true},
{"source_url": "matrixeyescounter.xml","source_text": "👨‍💻Level 2 | 👀 Otto eyes counter |","visible": true},
{"source_url": "fizzbuzz.xml","source_text": "👨‍💻Level 2 | 🎮 Fizzbuzz |","visible": true},
{"source_url": "matrixtest.xml","source_text": "👨‍💻Level 2 | 👄 8x8 LED mouth matrix test |","visible": true },
{"source_url": "matrixmouths.xml","source_text": "👨‍💻Level 2 | 👄 8x8 LED mouth emotions | ","visible": true },
{"source_url": "matrixsing.xml","source_text": "👨‍💻Level 2 | 👄 8x8 LED mouth sing |","visible": true },
Expand All @@ -35,6 +37,11 @@
{"source_url": "ledpot.xml","source_text": "👨‍💻Level 2 | 💡 Single LED + potentiometer |","visible": true },
{"source_url": "ledfadepot.xml","source_text": "👨‍💻Level 2 | 💡 Single LED + potentiometer fade effect |","visible": true },
{"source_url": "servoadvanced.xml","source_text": "👨‍💻Level 2 | 🦿 Servo advanced control | ","visible": true},
{"source_url": "neopixel.xml", "source_text": "👨‍💻Level 2 | 🌈 Neopixel Color LED |","visible": true },
{"source_url": "neopixelfunctions.xml", "source_text": "👨‍💻Level 2 | 🌈 Neopixel Functions |","visible": true },
{"source_url": "neopixelclockwisecounter.xml", "source_text": "👨‍💻Level 2 | 🌈 Neopixel Clockfun |","visible": true },
{"source_url": "neopixelgame.xml", "source_text": "👨‍💻Level 2 | 🌈 Neopixel Game |","visible": true },
{"source_url": "Police_Siren.xml", "source_text": "👨‍💻Level 2 | 🌈 Color neopixel LED police siren |","visible": true },
{"source_url": "IFTTT.xml","source_text": "👨‍🚀Level 3 | 🐱‍👤Ninja + ☁️ IoT IFTTT | ","visible": true },
{"source_url": "MQTT.xml","source_text": "👨‍🚀Level 3 | 🐱‍👤Ninja + ☁️ IoT MQTT |","visible": true },
{"source_url": "NTP.xml","source_text": "👨‍🚀Level 3 | 🐱‍👤Ninja + ☁️ IoT NTP | ","visible": true },
Expand All @@ -50,24 +57,23 @@
{"source_url": "oled.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display |","visible": true},
{"source_url": "oledshapes.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display shapes |","visible": true},
{"source_url": "oledframe.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display frame | ","visible": true},
{"source_url": "oledicon.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display icon | ","visible": true},
{"source_url": "oledanimation.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display animation | ","visible": true},
{"source_url": "oledanimationwalk.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display animation walk | ","visible": true},
{"source_url": "Oledspectrumgraph.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display Spectrum graph | ","visible": true},
{"source_url": "oledicon.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display icon | ","visible": true},
{"source_url": "oledmouth.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display mouth | ","visible": true},
{"source_url": "oledmouths.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display mouths | ","visible": true},
{"source_url": "oledlogo.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display Logo | ","visible": true},
{"source_url": "oledlogo.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display Logo animation | ","visible": true},
{"source_url": "Oledspectrumgraph.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display Spectrum graph | ","visible": true},
{"source_url": "oledgyro.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display with Gyro sensor | ","visible": true},
{"source_url": "servocalibration.xml","source_text": "👨‍🚀Level 3 | 🖥️ OLED display with Servo motor | ","visible": true},
{"source_url": "dhttemp.xml","source_text": "👨‍🚀Level 3 | 🌡️ DHT Temperature in OLED display |","visible": true},
{"source_url": "oledlaser.xml","source_text": "👨‍🚀Level 3 | ⚡ OLED display with Laser sensor | ","visible": true},
{"source_url": "Laser_Theremin.xml","source_text": "👨‍🚀Level 3 | ⚡ Laser sensor into Theremin |","visible": true },
{"source_url": "neopixel.xml", "source_text": "👨‍🚀Level 3 | 🌈 Color neopixel LED |","visible": true },
{"source_url": "Police_Siren.xml", "source_text": "👨‍🚀Level 3 | 🌈 Color neopixel LED police siren |","visible": true },
{"source_url": "dfmini.xml","source_text": "👨‍🚀Level 3 | 🔊 MP3 DF mini basics |","visible": true },
{"source_url": "dfminitriggers.xml","source_text": "👨‍🚀Level 3 | 🔊 MP3 DF mini Triggers |","visible": true },
{"source_url": "TFTicon.xml","source_text": "👨‍🚀Level 3 | 📺 TFT display Icon | ","visible": true },
{"source_url": "TFTAnimation.xml","source_text": "👨‍🚀Level 3 | 📺 TFT display animation | ","visible": true },
{"source_url": "irda.xml","source_text": "👨‍🚀Level 3 | 🎮 Remote infrared control |","visible": true},
{"source_url": "serverOTA.xml","source_text": "👨‍🚀Level 3 | 🌐 Server and OTA ESP8266 |","visible": true },
{"source_url": "MUvision.xml","source_text": "👨‍🚀Level 3 | 👁️ MU vision AI camera |","visible": true}
]
Loading

0 comments on commit 03860be

Please sign in to comment.