chapter 1: minecraft¶
1.1 All tech books¶
모든 기술 서적은 상기 사이트에서 찾을 수 있음.
Beginning Blockchain Bitcoin Essentials Bitcoin For Dummies Bitcoin for the Befuddled Building Games with Ethereum Smart Contracts Decentralized Applications Mastering Bitcoin, 2nd Edition
1.1 minecraft+scratch¶
https://github.com/mpatrascu/ScratchMC
python 3.7 install¶
sudo apt-get update -y
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar xf Python-3.7.0.tar.xz
cd Python-3.7.0
./configure
make -j 4
sudo make altinstall
sudo ln -sf /usr/local/bin/python3.7 /usr/bin/python
/usr/local/lib/python3.5/dist-packages/mcpi/minecraft.py
/home/pi/Desktop/mcpi-scratch-server.desktop
Exec=lxterminal --command="/bin/bash -c 'python2 -i /home/pi/Documents/MCPiScratch/mcpi-scratch/mcpi-scratch-server.py'"
python pip install¶
sudo apt-get install python3-pip
To get the Python 2 version:
sudo apt-get install python-pip
For example, the following command installs the Unicorn HAT library for Python 3:
pip3 install unicornhat The following command installs the Unicorn HAT library for Python 2:
pip install unicornhat
denosawr¶
https://denosawr.github.io/mcpi-scratch/
curl -s https://denosawr.github.io/mcpi-scratch/install.sh | sh
mcpi-scratch는 python2에서 동작함 /home/pi/Desktop/mcpi-scratch-server.desktop 수정필요
1.2 A4S¶
https://github.com/damellis/A4S
raspberrypi¶
git clone https://github.com/damellis/A4S
git clone https://github.com/firmata/processing
>./build.sh
sudo apt-get install librxtx-java
- USB 확인
dmesg | tail *run.sh 수정
-Djava.library.path=/usr/lib/jni 추가
java -d32 -Djava.library.path=/usr/lib/jni -jar A4S.jar $@
*실행
./run.sh /dev/ttyUSB0
1.3 Scratch 3.0¶
scratch extension¶
https://scratch.mit.edu/discuss/topic/289503/
node_modulesscratch-blocks
npm install
npm link
You can also use the command python build.py to build scratch blocks, but from my experience, changes aren’t reflected in the GUI unless you run npm link.
https://github.com/larjohn/rpi-scratch3-mqtt
https://github.com/larjohn/python3-pigpio-scratch3-mqtt
scratch-guinode_modulesscratch-blocksblocks_vertical extensions.js default_toolbox.js
scratch-guinode_modulesscratch-blocksmediaextensions seanpen-block-icon.svg 추가
scratch-guinode_modulesscratch-blocksi18n
scratch-guinode_modulesscratch-l10nscripts build-data.js build-i18n-src.js
scratch-guinode_modulesscratch-vmsrcextensions
scratch3_seanpen index.js Scratch3PenSEANBlocks 변경
scratch-guinode_modulesscratch-vmsrcextension-support
extension-manager.js const Scratch3PenSEANBlocks = require(‘../extensions/scratch3_seanpen’);
scratch-guisrcliblibrariesextensions
index.jsx id와 아래 id가 일치
- const builtinExtensions = {
- pen: Scratch3PenBlocks, seanpen: Scratch3PenSEANBlocks, wedo2: Scratch3WeDo2Blocks, music: Scratch3MusicBlocks, microbit: Scratch3MicroBitBlocks, text2speech: Scratch3Text2SpeechBlocks, translate: Scratch3TranslateBlocks, videoSensing: Scratch3VideoSensingBlocks, speech2text: Scratch3Speech2TextBlocks, ev3: Scratch3Ev3Blocks
};
scratch-guisrcliblibrariesextensions
index.jsx
import seanpenImage from ‘./seanpen.png’; import seanpenInsetImage from ‘./seanpen-small.svg’;
cratch-guisrcliblibrariesextensions 이미지 등록
scratch-guitranslationsmessagessrcliblibrariesextensions index.json
mblock bluetooth¶
Microbit docker¶
docker pull kadok0520/pxt-microbit
docker run -d -p 80:80 –name pxt-microbit01 kadok0520/pxt-microbit