Official thread for ArduinoOS

Off topicProgramming → Official thread for ArduinoOS

Hey, i thought id make one, shit can’t hurt maybe i can get some advice aswell C:

So this project started off with me getting an arduino uno and a LCD, from there i moved on to using my tv as a display, however it was glitchy and not very hi res, 32x32 64x64 at most due to memory restrains, and black/white so i got a arduino mega, and a touch screen lcd 320x240 16 bit color with sadly no dedicated GPU, and a sd card slot. Sorry not a very good picture, camera won’t focus…

So there has been plenty of improvements made and as of right now, this is how the project looks. PICTURE SPAM TIME

This would be the startup screen, initializes all the things it needs, and make sure touch works, if not it will restart itself.

The homescreen, note that the colors dont go well witht he camera, they are acctualy a very strong yellow.

So lately ive been adding small little features, one of them being a popup system, (doesnt look the prettiest, but its working…) There is 1 diffrent popups the functions knows, with and without buttons. So the way this works its a function that takes in 3 string arguments and 1 boolean, the string arguments being for the 2 buttons and main text. Boolean decided if its a button popup or no button popup, and thus handles it accordingly, with buttons it checks wich button was pressed and then returns a boolean value. Without buttons it just waits for a touch and exits.

So the explorer menu has a bit of an overhaul, it used to instantly do a default function when you clicked on anything in the list, now it has a selection and an open button. aswell as displaying the current path at the top.

It loads pictures aswell as text files Pictures need to be .raw format

And for creating files / folder and renaming and such i created a pretty basic QWERTY keyboard, didnt put much work into making it pretty or have more features since i dont need that atm. The keyboard has an constant 2d char array that can be easily changed, and that will change the keyboards functionality, then it has a char array buffer that stores the characters you type in, after * is pressed it returns with that buffer. The key detection is made with some looping namely, taking the x,y coords of the touch and looping the buttons width/height until it fits inside a button.

Ive now also added a system to download files from my PC to the SD card of the arduino, without having to take it out and slot it in my laptop everytime, it was time wasting.

This is quite slow compared to modern download speeds, but takes about 15-20 seconds to download a full sized picture wich is about 15 kilobytes, and about 2 hours for 20 megs haha. fast enough for my needs however.

This works with a 2 way communication, i will explain how and why. So the way it works is i have a python script running on my pc, with the desired file loaded into memory waiting for communication to be started by arduinoOs, so after clicking the download button it sends “ping” to the computer, the python receives it and sends “pong” back, now both of them know that they exist and communication is established. This system makes ArduinoOS the boss, and he sends the commands. The commands from ping then follow as , “fname” for filename, “fsize” for filesize and these are sent accordingly by the python script. After wich the arduino opens the fname file for writing, creates it and sends “snext” standing for send next. So the data is sent in packets of 60 to speed up the proccess, i used to have it byte by byte wich was slow as FUCK. This way arduino sends snext, python sends 60 bytes (the serial buffer on the arduino is 64 bytes, i can expand it but i dont want to waste memory) and then arduino writes it, and requests another 60 bytes, this is done so that the buffer doesnt overflow and data being lost. the other way of doing it, just sending as fast as possible and deal with it as fast as possible, would potentialy overflow the buffer.

After python reaches the end of file it sends “EOF” to the arduino, wich then terminates the program , syncs the file and exits. (thanks to dico and sheep for helping with the loading bar!)

ATM working on a basic interpreter for it, stuck on token saving… oh well with time comes wisdom

Redstone sheep is smart

I agree, the moosheep is ever intelligent

Nice! I think its a great idea to have a forum just for Audrino OS

1 The z and y are in the wrong place

Slovenian keyboard :) I can easily change it just by changing an array.

const char qwerty[3][30] = { { ‘q’, ‘w’, ‘e’, ‘r’, ’t', ‘z’, ‘u’, ‘i’, ‘o’, ‘p’ }, { ‘a’, ’s', ’d', ‘f’, ‘g’, ‘h’, ‘j’, ‘k’, ‘l’, ‘<’ }, { ‘y’, ‘x’, ‘c’, ‘v’, ‘b’, ‘n’, ’m', ‘.’, ‘/’, ‘*’ } };

the z and y are in the wrong place

1)gramatically, you are incorrect. It should be the y and z are in the wrong place. 2) no they aren’t. Thats a qwertz board, what they use where pan lives.

Wierd I have a different keyboard than you, :P
Most countries have their own style keyboard m8 :)
Anyway, im to lazy to put in capital and non capital and a nice space button and carriage return, but hey this one does the job for me atm :D

Small upgrade on the hardware side, bought a adafruit powerboost 500 shield, with a 2000 mAh battery, so now it doesnt constantly have to be plugged into a pc :D

As for the interpreter, i figured it out in theory, but im too sick atm to go and make myself code.

Weee progress on the interpreter, i decided to work on it today, got varible declaration (only ints atm) done! Aswell as i quickly added incrementing just to test the speed of this.

The syntax looks awfull this is beacuse its easy to interpret, for the first version it will be kinda like that :D, later versions will get more C like.

Anyway, the interpreted code

INT foo = 5 WHILE $foo$ inc PRINT $foo$ ENDWHILE

I havent yet done conditions, so the while loops are infinite atm , but good enough to test, i still need to do expression evaluating (not looking forward to that grind)

How is it going now @pan ? I assume with 5 months of work it is brilliant
i stopped developing it, focused on other projects
Well good luck with them :-D