doodlewind / react-ssd1306 Goto Github PK
View Code? Open in Web Editor NEW📟 A React Renderer for SSD1306 OLED chip on Raspberry Pi.
Home Page: https://github.com/doodlewind/react-ssd1306/blob/master/docs/tutorial.md
📟 A React Renderer for SSD1306 OLED chip on Raspberry Pi.
Home Page: https://github.com/doodlewind/react-ssd1306/blob/master/docs/tutorial.md
I download react.js from https://unpkg.com/react@16/umd/react.production.min.js
as your code:
import './polyfill.js'
import React from 'react'
const App = props => {
console.log(props.hello)
return null
}
console.log(<App hello={'QuickJS'} />)
qjs to run it said: "ReferenceError: could not load module filename 'react'"
so I changed import React from 'react' to import React from './react.js', this time
I got "SyntaxError: export 'default' in module './react.js' is ambiguous"
Could your help me to point where I made mistake.
If you have trouble compiling QuickJS on Raspberry Pi, just link the atomic
lib as seem in this discussion, this following patch should work:
diff --git a/Makefile b/Makefile
index efd3a32..3150f80 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,10 @@ CONFIG_LTO=y
#CONFIG_WERROR=y
# force 32 bit build for some utilities
#CONFIG_M32=y
+# compilation on ARM Linux
+ifeq ($(shell uname -m),armv7l)
+CONFIG_ARMV7=y
+endif
ifdef CONFIG_DARWIN
# use clang instead of gcc
@@ -167,6 +171,9 @@ LIBS=-lm
ifndef CONFIG_WIN32
LIBS+=-ldl
endif
+ifdef CONFIG_ARMV7
+LIBS+=-latomic
+endif
$(OBJDIR):
mkdir -p $(OBJDIR) $(OBJDIR)/examples $(OBJDIR)/tests
You can also simply change LIBS=-lm
to LIBS=-lm -latomic
in makefile :D
Thanks for taking the time to thoroughly share this original & fun experiment! Love it!
Would love to try to port this to an esp32 microcontroller!
前端侵入嵌入式领域是必然的。
这里想问的是,在物理层面交互的处理上,quickjs可以做桥梁吗?
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.