The use of micro -controllers in OpenComputer (including examples) [OC] Open Computer (Open Computers) Minecraft Game

Micro -controller, also known as a single -chip microcomputer, is a very simple computer.It does not have the ability to control other OC components, but it can achieve many unique functions.It is more flexible and convenient than the OC computer, and it is more stable and efficient than the robot.It is not an optional existence.

When a microcontroller shell is placed in a robotic assembly, the following interface will appear:

The difference between T1 and T2 shells on the use of upgrade components is only whether it can use T3 -level batteries, and the difference between inserting cards is whether they can use wireless network cards and secondary data cards.

The components that the microcontroller can use is very limited:

Upgrade components: geological analyzer, replacement device, solar panel, notice sign, piston, battery.

Plug card: network card (wireless network card), red stone card (high -grade red stone card), Dute network card, data card, world sensing card.

Through these components, the microcontroller can realize the interaction with the surrounding equipment and signals, or accept the control of the host.

Personal experience of choosing components:

Course: T1 shell is enough to meet most cases.

CPU: T1 CPU or APU can.Because the microcontroller does not have the ability to display, just use the CPU.

Memory: Use a T1.5 memory.

Upgrade components or plugging cards: Add according to the purpose of use, try not to add as much as possible.Not only will increase complexity, but also energy consumption.

The following is the point: the processing of EEPROM

The measured results show that: EEPROM is assembled in a microcontroller, and the content cannot be modified, so it can only be written on the computer or server.If there is an error in the assembled microcontroller, remove the microcontroller into parts with a decomposer and rewrite it into the program.

First assemble a computer, if you want to download the ready -made program, please don't forget to install the Internet card

Open, type Install to put the system into the hard disk.After restarting the hard disk, you can use it normally

Use the command Edit or Pastebin to be ready -made from the Internet.Here is a program that I practice with handwriting, extract the code to mjrfx8ee.Specifically use it later.

Open the chassis and pull out the guidance EEPROM when the computer is running.Be careful not to shut down because the computer cannot be started.Then insert a blank eeprom (those with data can be directly fled into empty on the synthetic table)

Find the directory:/dev/components/by-type/eeprom/0. This is the data storage location in EEPROM.The content of the file here is writing data to EEPROM.The files here can be modified and covered, but cannot be deleted.The program we want to run the microcontroller is the file here: Contents.Just cover this file with the program we just wrote or downloaded. If you have a small problem, you can directly modify it.

Take this EEPROM out of the computer and send it to the robotic assembly to synthesize the finished micro -controller with the shell.After this microcontroller is placed (don't forget to connect energy), right -click to turn on, and automatically execute the program content we wrote at the same time.When running normally, the power light is green. If it is red, it is wrong. You can sneak on+right -click to get error information.

Entry the purpose of the example program provided:

This is a feeder used to control the automatic production of compressors in the galaxy MOD.To achieve automatic production, the most troublesome thing is that the items need to be positioned.Because its GUI has 11 grids, 10 of which can receive items, and the items are preferred after entering, so there is no way to use the pipeline or ME interface to put them in the raw materials smoothly.I used to use the GT caliber to complete the feeding work, but the grid of the caliber was limited. Only a few formulas could be processed, and multiple sets of equipment had to be used to achieve fully automatic production.This microcontroller can realize the automatic production production of all dense boards in the galaxy and the 1-3-order increase plate. If there are more formulas, add a few data to the array ITEMS.

This is the component used by the microcontroller:

The basic shell is enough.In order to control the transfer of items, the plug -in: replacement device.

After all the equipment is placed, it is like this:

front:

later:

There are a few details to explain:

The microcontroller can use AE's energy, and even it can become part of the AE network, so the device connected to it will enter the AE network.In the front diagram, the ME interface on the right of the microcontroller is used as a container and cannot be included in the AE network. Therefore, all the one -piece of the microcontroller and the AE wire uses quartz fibers to isolate.energy.Use the ME interface as a container because the number of grids is more appropriate: enough and too much, too much grid will allow microcontroller to spend a lot of time to find.

After the microcontroller starts, it will automatically find the surrounding container (including equipment with grid).If the grid of the container is 11, it is considered to be a compressor; if it is 9 grids, it is considered to be a raw container (ME interface).You can adjust according to your own equipment. If you use the original box, modify the Source = CheckBox (Source, 27) of the second line of the program.If the electric compressor is used, there are 12 grids inside it, and the raw material grid is not 3 ~ 11 but 4 to 12. Then the tslot array defined in the program to define the array of each lattice attribute TSLOT array must also be modified.Please use a blocking mode for the ME interface of the output formula to avoid multiple formula mixing.

I chose the fuel of the compressor: the wooden stick/GT wood pulp/various original sapling (all 2 burned once, it is okay to mix in), and there is nothing from the fragmented coal.Because I am a obsessive -compulsive disorder, fuel waste is shameful!You choose or modify according to your preference.

The finished product of the compressor can only be removed from the bottom surface, and the raw material can be delivered from any surface outside the bottom surface. Therefore, a ME input bus is used at the bottom of the compressor to absorb the finished product.

Metal ingot is the code of the GT metal ingot. If you do n’t install the GT, please change it to the item code corresponding to your own module.I added labels after each data. The only purpose is to look convenient.I haven't found the method of visiting the mineral dictionary with LUA, if anyone knows to ask me.