GithubHelp home page GithubHelp logo

electroblocks / electroblocks Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 5.0 57.89 MB

This is an Arduino simulator that allows you to code with a drag and drop language called Blockly.

Home Page: https://electroblocks.org

License: GNU General Public License v3.0

JavaScript 39.66% TypeScript 53.80% HTML 0.07% CSS 0.08% Svelte 6.40%
arduino blockly drag-n-drop similutor

electroblocks's Introduction

ElectroBlocks

So we are working on contributing docs. Right now everything is setup for people to add boards and their own libraries as well. I am working on what that process will look like and the documentation for that process. I will definitely be asking for a lot of help so if you have ideas please let me know.

Code Coverage

codecov

License

License: GPL v3

electroblocks's People

Contributors

dependabot[bot] avatar justinbetabox avatar phptuts avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

electroblocks's Issues

Buzzers

  • Find library
  • Add to Arduino-CLI library
  • Get SVGs
  • Generators
  • Add Component
  • Tests
  • Add the component to Arduino

Stepper Motor

  • Find library
  • Add to Arduino-CLI library
  • Get SVGs
  • Add the component to Arduino

Remove the Board Selector

Why

  1. It has nothing to do with the coding of the app and can be put into setting
  2. Adds noise to the overall process
  3. Some boards like the micro bit will require a complete redoing of the Blockly toolbox
  4. Switching boards is a scarce thing. Meaning most people will stick with one for a bit.

Chrome 85

Chrome 85 does not work with the avrgirl-arduino library. Might take care of itself.

LiquidCrystal

  • Add Liquid Crystal to server
  • Modify the Generator Code
  • Modify the wiring / virtual circuit

Might not do this one because I found an i2c convertor. That would make it work. It seems the breadboard connections would be really hard.

FastLED Custom Blocks Won't Generate Code

Hello!

As soon as I submitted my first issue, I realized where to look and fixed it.

Now my blocks show up in the drawer but the code will not populate in the code window.

Adding one of the custom blocks causes all other blocks to break as well.

Any thoughts?

I've included a picture of the problem and here is the code for my generators.ts file.

`import Blockly from 'blockly';
import _ from 'lodash';

Blockly['Arduino']['fastled_setup'] = function (block) {
const numberOfLeds = block.getFieldValue('NUMBER_LEDS');
const pin = block.getFieldValue('PIN');

Blockly['Arduino'].libraries_['define_fastled'] =
'#include <FastLed.h>;\n\n' +
'CRGB leds[NUM_LEDS];';
Blockly['Arduino'].setupCode_['fast_led'] = '\tFastLED.addLeds<WS2811, ' + pin + 'GRB>(leds, ' + numberOfLeds + ');';

return '';
};

Blockly['Arduino']['fastled_set_color'] = function (block) {
Blockly['Arduino'].functionNames_['set_color'] =
'\n\nvoid setNeoPixelColor(double pos, RGB color) {\n' +
'\tpos = pos <= 0 ? 0 : pos;\n' +
'\tpos = pos >= 1 ? pos - 1 : pos;\n' +
'\tpixels.setPixelColor((int)pos, color.red * brightness, color.green * brightness, color.blue * brightness);\n' +
'\tpixels.show();\n' +
'}\n';

let color = Blockly['Arduino'].valueToCode(
block,
'COLOR',
Blockly['Arduino'].ORDER_ATOMIC
);

if (_.isEmpty(color)) {
color = '{ 0, 0, 0 }';
}

const position = Blockly['Arduino'].valueToCode(
block,
'POSITION',
Blockly['Arduino'].ORDER_ATOMIC
);

return '\tsetNeoPixelColor(' + position + ',' + color + ');\n';
};
`

Screen Shot 2021-12-08 at 4 23 50 AM

ElectroBlocks Code View

So the code view needs a margin-bottom: 10px on the pre element so that it can scroll all the way down.

Remove lodash

See if you can remove lodash with modern javascript.

Centering Bug

When you don't have any blocks and go from the Arduino page to the home page, it does not center properly.

Remove unnecessary code for digital display

Purpose

Remove the unnecessary code for the digital display. Notice the variable digitalDisplayPrint123 is not being used for anything.

int simple_loop_variable = 0;
struct RGB {
	int red;
	int green;
	int blue;
};

#include "SevenSegmentTM1637.h"
String digitalDisplayPrint123 = "";
const byte PIN_CLK = 11;   // define CLK pin (any digital pin)
const byte PIN_DIO = 10;   // define DIO pin (any digital pin)
SevenSegmentTM1637    digitalDisplay(PIN_CLK, PIN_DIO);





void setup() {
  digitalDisplay.begin();
    digitalDisplay.setBacklight(100);

}


void loop() {
  // Sets the text and turns the colons on and off.

    digitalDisplayPrint123 = String(" 100");
    for (int i = digitalDisplayPrint123.length(); i < 4; i += 1) {
      digitalDisplayPrint123 += " ";
    }
    digitalDisplay.clear();
    digitalDisplay.setColonOn(true);
    digitalDisplay.print(String(" 100"));

}

Add Auto Resizing

When a user resizes their window we should trigger a resize event.

Led Matrix Bug

It's assigning the wrong led number to the led matrix. We need to reverse the x and y and start at 0.

// x = 2, y = 3 parameter

Create a self host environment option

Create a virtual environment that does not require the internet for people with bad internet. Nice to have would be able to make it deployable on the raspberry pi.

Create Documentation

Create Docs

  • Adding Boards
  • Adding Components
  • Adding / Modifying blocks
  • Tour of site
  • Everything else

Sending Message Bug

Purpose

When sending a message you don't see the message that you sent appear on the screen. Should be an easy fix.

Linux does not work

The serial API for Linux returns an array of ports and not a single one. I will need to investigate this more text time I can access a Linux box.

Starters

Starters

We need starters for electroblocks. Basically predone projects that just need a little bit of logic.

Block Improvement

Add Blocks

  • If Blocks should have if-then and remove the do from it. Like Scratch
  • See if it's possible to put the for loop block in line.
  • Add runs (x) Times in the virtual circuit to the loop block.

RGB LED Fix

We need to make the resistors not be plugged in the same row as the wires they are connecting.

Multiple List Bug

I should be able to select from the list of numbers when using get an item in list block or a set item in list block.

Screen Shot 2021-12-30 at 10 32 03 PM

ESP8266 Chip

It would be amazing to get this chip working with ElectroBlocks. I think we only need a few versions of the chip. If we can flash online that may be the way to go.

LED Resistor

Fix the led resistor that it plugs into ground and not into the same row.

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.