Comments (6)
Unfortunately I have zero experience with what you are trying to do. However, my reading suggests you should be able to wrap your library as a node.js module with a JavaScript interface. Then, with your node module installed, it would be easy to call it from the Node page of a Coder app. With a little more JavaScript and html you could provide the front end and complete your app.
I imagine the hardest part is wrapping your python code in a module. I'd look for existing modules that might serve as examples of wrapping non-js code. I think this is how node is implemented, so there should be plenty of examples. And, maybe the node docs have a detailed explanation.
I found wikipedia a good place to start when learning about node: http://en.wikipedia.org/wiki/Node.js
from coder.
@karan259 this is great. I think that if I were going about this, instead of cross compiling, I'd create a little daemon in Python that exposes a simple http/json API on a port on localhost. Then you can talk to that daemon easily from node.js in coder. You could also make a nice bundle in Coder, say "BrickPiLib", that provides a common library/interface for front end and back end javascript to to shuttle commands to the lego modules.
Your Python daemon probably needs to keep track of all the sensors and motors and then expose api endpoints like the following, and any coder node.js -- or a nice wrapper you make in BrickPiLib ;) -- should be able to talk to it fairly easily.
POST /sensor/[0,1,2]
data:
'type': [touch,temp,light,...]
GET /sensors
returned data:
{
sensors: [
{ 'type': 'touch', 'value': 'pressed' },
{ 'type': 'raw', 'value': .0012 },
{ 'type': 'temp', 'value': 101.03 }
]
}
POST /motor/[0,1,2]
data:
'direction': [0,1]
'speed': 50
...
GET /motors
returned data:
{
motors: [
{ 'direction': 0, 'rotation': 3, 'speed': 50 },
{ 'direction': 1, 'rotation': 0, 'speed': 59 },
{ 'direction': 0, 'rotation': 12, 'speed': 0 },
]
}
from coder.
@ericgundrum Creating a Node.js module is one way of going forward but since I have zero experience in that, it might be too much for me at this time. @jmstriegel using a python daemon with JSON looks like a good way forward. It may even allow us to support other languages too. Thanks for the reply
from coder.
Hi Karan,
I have developed (and am continuing to develop) a system that works with the BrickPi, which includes using Coder itself as well as another Google tool, Blockly. Feel free to check out our code here: https://github.com/tufts-LPC/blockytalky
from coder.
So, this may sound like a super stupid question so pardon my lack of
awareness, but I am really interested in what you are sharing here. What
actual parts do I need to experiment with this code and your ideas?
On Mon, Nov 18, 2013 at 4:03 PM, Joe [email protected] wrote:
Hi Karan,
I have developed (and am continuing to develop) a system that works with
the BrickPi, which includes using Coder itself as well as another Google
tool, Blockly. Feel free to check out our code here:
https://github.com/tufts-LPC/blockytalky—
Reply to this email directly or view it on GitHubhttps://github.com//issues/49#issuecomment-28742704
.
-------------------------------------------------
Aaron Maurer
--------------------------------------------------Q: Why is this email
five sentences or less?A: http://five.sentenc.es http://five.sentenc.es
*MY BLOG *http://coffeeforthebrain.blogspot.com/
*ABOUT ME *
http://coffeeforthebrain.blogspot.com/p/coffee-for-brain-book-swap.html
*TWITTER *https://twitter.com/coffeechugbooks
*GOOGLE + *https://plus.google.com/u/0/113960577497815089175/posts
This email is off the record (blogs and tweets too) unless we agree
otherwise.
from coder.
If you have the BrickPi (and I'm assuming a Raspberry Pi since you're looking at Coder) you already have everything you need to get going. Just clone the repo, follow the install instructions, and you'll be off and going. BlockyTalky works side by side with Coder, and we hope to soon add functionality in Coder to create interfaces for BlockyTalky.
from coder.
Related Issues (20)
- add the code to a website
- Long wait with no user feedback after login HOT 1
- Blinky Lights coder project bug
- Chromebook " issue. HOT 2
- The Mac Installer bundles an older version of raspi.img file HOT 1
- Coder + RPi + Arduino with Sensors Possible?
- Raspberry Pi 3 HOT 16
- Installing TWEEPY through ssh
- error starting localserver.js HOT 1
- Multiple users in Coder server
- Installation Error Using Mac Installer HOT 4
- Unable to install coder manually on raspbian lite
- Raspberry pi 3 not booting up with coder HOT 7
- installed bonjour print services still not able to access http:coder.local HOT 2
- Google Coder as a Background service?
- Install using Etcher
- Is it possible to run Coder on windows? HOT 1
- Pi Zero W
- Hi
- Coder HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coder.