project-empress-blog
project-empress-blog
Project Empress
9 posts
I'm telling a story about trying to write software in javascript and python, do model rocketry from scratch and being clueless but excited about electronics. It's called Project Empress because I'm about to rule it!
Don't wanna be here? Send us removal request.
project-empress-blog · 7 years ago
Text
What is going on there?
Tumblr media
Hi there!
New post(after one milion years) and introduction of new possible categories - #rocketry and #python, due to changes in my life!
After recently posting lot on #instagram I’ve decided I want place where I can write something longer than photo description. Instead of creating brand new blog I remembered I already have this one. I like how it looks and I think old articles may be still useful. So it’s come back after really long break.
I’m not sure what this blog is going to be - till now I considered that only very concrete, tutorial post with completed project is worth posting. I’ve also posted them for my own usage - I can come back to articles I wrote when I forgot something. I’m nearly 100% sure that it’s not going to change - maybe I would do bigger projects and post multi-part tutorials?
0 notes
project-empress-blog · 8 years ago
Text
Pixi.js point and click game tutorial
I’ve slightly broaden the spectrum of topics raised on my blog. I want to write about everything I’m coding, so let the new category - #javascript - say hello world. 
I’ve recently heard about JS13kGames Competition and i’m really excited and motivated to submit the entry. In the meantime our local gamedev group is organising a monthly meeting with microjam - tiny game competion. This month’s theme is MURDER. I think it’s nice warmup.
I know nothing about game development, but I can tell some story in simple, point and click way. Framework I’ve picked to do this is PixiJS.
Tumblr media
Getting started
I’m used to link all the dependencies from CDNs like this from cdnjs.com if it’s possible. Using learning Pixi docs to quick start.
index.html
<!doctype html> <html> <head>    <meta charset="utf-8">    <title>The game</title> </head> <body> <script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.5.4/pixi.min.js"        integrity="sha256-OeeS98OP4PNpgc5B8mKkGf1/sZvUitl4R53KSHpSQOk="        crossorigin="anonymous"></script> <script src="main.js"></script> </body> </html>
main.js
//Create the renderer var renderer = PIXI.autoDetectRenderer(800, 600); renderer.backgroundColor = 0xff1d8e; renderer.view.style.display = "block"; renderer.view.style.margin = "auto"; //Add the canvas to the HTML document document.body.appendChild(renderer.view); //Create a container object called the `stage` var stage = new PIXI.Container(); //Tell the `renderer` to `render` the `stage` renderer.render(stage);
Now we have the plain stage for our game components. I’ve coloured mine pink.
Clickable object
Point and click game mechanics is based on pointable and clickabe objects. Let’s create some!
For texture to my object I’ve used a sprite created with Piskel online tool, it’s a picture of hand console. I’ve replaced the last line of my main.js fle with:
PIXI.loader    .add("HandConsole","hand_console.png")    .load(setup); function setup() {    var hConsole = new PIXI.Sprite(PIXI.loader.resources.HandConsole.texture);    hConsole.position.set(10, 10);    stage.addChild(hConsole);    renderer.render(stage); }
As in docs metioned before I’ve added loader object, which loads assets and then run the game setup. Game gets more scalable with that. To make created sprite clickable I used code from example.
hConsole.interactive = true; hConsole.buttonMode = true; hConsole.on('pointerdown', function() {    console.log("clicked!"); });
It's very important to set interactive flag to true. Second line shows the hand coursor over the image, and last three is the watcher of click or tap event. 
Last thing I’ve done is fancy text.
var style = new PIXI.TextStyle({    fontFamily: 'Arial',    fontSize: 36,    fill: ['#FF791F', '#FF0C3E'], // gradient    stroke: '#000000',    strokeThickness: 5,    dropShadow: true,    dropShadowColor: '#000000',    dropShadowBlur: 4,    dropShadowAngle: Math.PI / 6,    dropShadowDistance: 6,    wordWrap: true,    wordWrapWidth: 440 }); var clickText = new PIXI.Text('Aww, you clicked!', style); clickText.x = 20; clickText.y = 180; hConsole.on('pointerdown', function() {    stage.addChild(clickText);    renderer.render(stage); });
0 notes
project-empress-blog · 8 years ago
Text
Logic Level Converter explained
Tumblr media
Logic level converter on my prototyping board, paired with bluetooth module
There’re tons of electronics guides and tutorials online, but most of their authors assume that you have plenty of knowledge about electronics or you just won’t go into details. ‘Plug in logic level converter’ - you’re plugging it in, and it works. I’m totally beginner and maybe it’s wrong way, but I’m not following any tutorial, just googling elements I want to include in my project in order. But what’s that, logic level converter?
All that little one is doing is ‘lowering’ the level of high(1).
I need it because bluetooth module i’m using is generating signal with maximum of 3.3V. Although all of this is just sequence of 0 and 1, and my bluetooth 1(high level, this image would propably explain this logic levels) is 3.3V unlike the default high level of 5V and output without levels converter will be always 0, so basically - nothing would happen. If I would plug in my signal to converter(i also need to plug in stable 3,3V vcc), i’ll get the same sequence of 0s and 1s for both sides, no matter if it’s ‘powered’ by 3,3 or 5V.
0 notes
project-empress-blog · 8 years ago
Text
Blinking LED on Atmega32 - complete guide
Tumblr media
I’m trying to make a 101 of first Atmega32 on prototyping board project, on example of blinking LEDs. All of this knowledge is already somewhere on the internet, but i couldn’t find complete guide.
That was my firs time doing such a thing, so it’s guide from begginer to begginers, I hope I understood everything well.
I’m using prototyping board, Atmega32 microcontroller and USBasp programmator, To mount microcontroller on board I used schema found in this article(unfortunately in polish only, but pictures are uderstandable for everyone). What’s going on on this diagram?
It might seem pretty scary, but it’s not. Let’s look at pinout of Atmega32 - microcontroller is driven by electric signals which it is processing. Each pin is responsible for another little quest, and to deliver the right signal to the right pin, at the right moment, we need to limit and controll the currency and voltage in circuit with some resisors, capacitors or coils. All we need to do is follow the diagram. Almost all of the connections is a wire or one element going straight from pin to the ground or power supply. It’s also important to connect + and - buses on the ends of the prototyping board. How does it look?
Tumblr media
Recommended microcontroller setup
Getting pin description and glueing it to microcontroller helps a lot. Next thing to plug in is a programmator. We can buy adapter, or spend some time to understand and plug pins on our own. To do this, one more time we need pinouts. On this image we can see USBasp pins, it’s also numbered as it goes on the tape. When we separate the tape(it’s made of kind of small wires glued together), we can directly put the wires to corresponding pins on microcontroller. For example, the first out pin on the programmator is MOSI, so we have to find MOSI on Atmega pinout(6th pin) and connect it.
Tumblr media
Maybe this picture will make things clear
Last thing before programming - plugging in LEDs. Before we connect it to the microcontroller, we have to limit currency - to high would burn the LED. I’ve found good article about how to pick resistor for your diode, so come on and read it if you want to understand what’s going on. If you don’t have time, you can just check what resistor sholud you use by the LED’s color. 
If everything’s in place we can turn on the computer. Firstly - you propably don’t have a driver for USBasp. There might be some problems with drivers authentication, but web is full of tutorials. We are also going to use Atmel Studio, that is an offshoot of Microsoft Visual Studio and AvrDude(you can download it here, and all you have to do is unpack it and place avrdude.exe file in your Atmel Studio files).
Let’s make a new project. I’ve used the steps from this article, from section  Getting Started with Atmel Studio 6.0, although I’m working on version 7. You can see(and use) my program on GitHub. I’ve tried to explain everything in a comments, but to be clear let’s find out how exactly we can refer to each of pins. 
To set pin to high(1, led is blinking), we have to put a mask on port bits. General pattern is: PORTx = PORTx | (1<<n); where x is an port mark, and n is pin number).
So - we have a program and a board plugged in by USB. How to transfer program to microcontroller? In Atmel Studio, we can set up a macro to do it easily multiple times. Full guide can be found here(in polish, but author of  this article is using english version of Atmel studio, so it’s everything shown clearly on screenshots). After going to Tools>External Tools, we would see screen like this. We have to fill areas with choosen title, path to avr dude executable in Command section, and arguments for avr dude. Mine is:
-e -U flash:w:$(ProjectDir)Debug\$(ItemFileName).hex:a
Things like $(ItemFileName) is variables built in Atmel Studio. When we have out custom tool, we have to add it to the toolbar - going to Tools>Customize, in Commands section we can see our new command as  External Command 1.
All w have to do now is build our program and use defined command to transfer program to microcontroller. And if everything is done well, your LEDs should blink! How cool is that?
1 note · View note
project-empress-blog · 8 years ago
Video
youtube
Video from ABB Polska Youtube channel
So project-empress is evaluating! I’ve signed in to ABB IT Challenge with my friend as The Tractors team and today our qualification get announced! We’re in with literally the project I’m buidilng - smart plant pot, but it gets an upgrade and whole new dimension unless we want to present it as brillant education tool for litte ones from big cities. Even now there’s bunch of kids who think, that vegetables comes form grocery store, instead of understanding their origin - soil, water and sun. With our pot and dedicated app, child can learn about natural processes, control it(even kill the plant) in fun way. We have time till 15.05 to build something and present it. Keep fingers crossed!
0 notes
project-empress-blog · 8 years ago
Text
Electronic basis
Tumblr media
Thing on the picture is USBasp programmator. I’m gonna use it to transfer program from my laptop to Atmega32 microcontroller.
Hi there!
I’m taking very first steps to electronics. Before I’ll be able to make system which is my goal - autonomic plant pot, for warmup i’m up to build something like ‘Hello world!’ in electronic - blinking LED system. I’ve got specified recipe for both - constructing and programming this little one. 
Internet suggests an Arduino parts for begginer like me, but it’s expensive and almost all work is done - I wouldn’t have had to write hardly any code, because Arduino have built-in libraries. For me ‘almost all work done’ is not the best solution, because I wanna learn!
So I have to provide myself pretty much tiny things - prototyping board, microcontroller, programmator, capacitors, resistors(why are they neccesary, according to my knowledge resistor does nothing), LEDs, crystal(it sounds fancy, but it’s for real quartz oscillator that provides a clock signal for circuit by the resonance phenomenon), and a lots of wires. Stay in touch to watch me building and programming this first, basic circuit.
1 note · View note
project-empress-blog · 8 years ago
Text
Pre-Phase alias Research Phase
Tumblr media
I’ve never really done anythig embedded, robotic, also I don’t know much about gardening. It doesn’t seem good, if I want to build automatic garden, does it? First week is research week! Firstly I need to find out how to compile C program in CLion from JetBrains. Is it good IDE? I’ve picked it because I absolutely love WebStorm, and I’m using it at work all time, but previously I used only Bloodshed Dev Cpp. I’m also quite new to C language, I know some objective basics, but I still don’t understand fancy stuff like pointers.I think they might be useful. I have tons of knowledge to absorb in topic of growing plants. Majority of usable information i’ve found yet comes from illegal indoor marijuana growing 101s. Whatever I’ve learnt about lightning, irigation, isolation, temperature control etc. I’ll describe it closely on design phase. I’m going for custom 3D-printed pot, I’ve been also wondering of some PDLC film - intelligent film that’s transparency depends on how much electric power is provided, but it’s really expensive and I don’t really know if needed(but super cool for sure).
I have a plan to record a video to the end of a week, in which I would tell more about the project, explain everything.
Just read the instructions!
1 note · View note
project-empress-blog · 8 years ago
Photo
That’s what I have for now. Haven’t figured out how to publish instagram photos on certain tumblr blog(i have moar than one).
Tumblr media
#learningC #programming #wantstobuildrocketships #workspace #tech #instacode
1 note · View note
project-empress-blog · 8 years ago
Text
Hello world
Hi, I’m Milena, I’m starting a blog
0 notes