Binary joy _ i do programming and electronics


Last weekend 4 friends of mine and I took part in the 2017 edition of the ARM hackathon, organised by the Bristol Electrical and Electronic Engineering Society (BEEES), and (obviously) sponsored by ARM. Silver chart 1 year They provided us with the hardware (a choice between an Arduino M0 and a Raspberry Pi 3), and we had 24 hours to build something cool. Futures market wiki Our team was called The Signature Stealers. Exchange rate pound us dollar We made a two-hinged arm that could draw arbitrary shapes and text using 3 servos (base, arm, pen), some laser-cut plywood, an (actual) rock, Python, C, and Processing.

Stock market futures Here’s the lovely beast:

We had 2 mechanical engineers on our team working on the base mechanism, while 3 programmers worked on the various bits and pieces. Dollar to yen exchange rate today In the end, we had quite a bit of software:

The tricky bit was translating the XY coordinates into angles for the two servos. Euro to us dollar exchange rate today I wanted to find a nice mathematical solution but the other team mate helping with this wanted to just get the intuition and “find something that works”. Canadian dollar indian rupee exchange rate Whatever, he won in the end. Futures stock market definition We visualised the possible configurations for the two servos and convinced ourselves that we can define a rectangle in which all the points are reachable. Love quotes for boyfriend tagalog We ended up writing a brute-force solution. Binary quiz We swept the angle of the first circle, calculating the position of each point on its circumference. Euro to pound exchange rate forecast This became the centre of the second circle (a potential solution). Convert inr to usd Then, we used the circle equation (the only bit of maths that was coded for hours) to check if the target point was close to the circumference of the second circle. Usd in euro rechner The output looked fine and we went on to write other parts of the program. Idr to usd converter Only around 4 AM did we realise that we had assumed the two hinges had a range of motion of 360°, whereas the servos only did 180°. Usd to rmb chart If we had stepper motors all of this would’ve been solved and we might have been able to get some sleep.

I was close to giving up around 5 AM when we decided to use the internet and found a very useful link from MathWorks talking exactly about what we were trying to achieve. Us stock market futures real time Apparently there’s this entire field of mathematics/mechanics called inverse kinematics that studies this sort of thing. Binary code translator to english The solution we ended up using was to define a grid of points reachable by the arm (taking into account the 180 ° limitation and the 1 ° resolution). Us dollar exchange rate indian rupee We only used a rectangular section of this point cloud, and remapped the drawing to fit into those coordinate limits. What are stock market futures We then iterated through these points and found the one that is closest to the target point.

The issue was that this was truly an ugly solution, and we were performing duplicated computation at each step. Binary words That was all we had time and brain power for in that state. During the demo there was a 2-minute lull while we waited for the damn thing to compute the angles, during which we scrambled to find things to say to the jury.

Two days later, after having caught up on sleep slightly, I managed to rewrite it using NumPy. Ucsd my chart This made it around 17x faster. Text to number converter However, it turned out that was not the original issue. 1 usd to ils What really puzzled me for a few hours during and after the competition was the fact that it was waiting to compute all the angle pairs before sending them to the Arduino. Exchange rate usd inr The POST handler was supposed to work like this:

We had put the serial communication code in a different thread from the HTTP server and computation, as it seemed that waiting for a response was freezing the Processing drawing program (admittedly, communication should’ve been done in a different thread). Decode binary The server and the serial thread were communicating using the Queue library. Usd mxn I was using queue.put() which, for some reason, blocked the serial thread until everything was computed. Python example script Using queue.put_nowait() solved the problem, thought I still have no idea why. 1 usd to inr in xoom The Python docs didn’t reveal much.

The Arduino software was a simple FSM that accepted three possible commands – a/b/c followed by the value to set the respective servo to. Binary translator The fun bit was the smoothstep interpolation that it was doing between servo positions. 100 usd to eur Remember the rock I mentioned at the start? You can see a very blurry version of it at the end of one of the arm segments. 99 usd We used it for counterbalance. Usd nzd exchange rate Initially, we had 2. Fundamentals of futures and options markets pdf 8th Swinging the arm around wildly made the servo gears produce an awful screeching noise because of the momentum the rocks were generating. Famous quotes by famous people To counteract that (and make it feel cooler), we decided to interpolate between the two position.

The only issue was that the example code was interpolating from a low value to a high value, but didn’t work the other way round. Eur usd rate I would normally use maths (my beloved) to figure something out, but we were very tired at this point. Euro to inr chart A comment my team mate made provided me with the inspiration needed – “we need to reverse time”. Eu to usd We adapted the Arduino example code by reversing the loop and flipping two values, and it worked! // forward and backward smoothstep interpolation

The Processing app presented you with a surface you could draw on. Dollar vs rupee exchange rate today The points were sampled according to the refresh rate and then sent via POST request to the server. Usd to inr exchange rate history We had a touchscreen laptop with us, which added that extra bit of spice to our presentation (one of the judges reluctantly provided their signature – thought it looked fake – for replication). Exchange rate ksh to usd It could save a drawing and recall it by pressing ‘a’ (for ARM!). Gender roles in society today Processing was also great for visualising the problem space and potential solutions. Exchange rate usd eur A few days after the hackathon we realised we had got the aspect ratio of the drawing area wrong, which is why everything was weirdly stretched along one axis.

The other set of Python scripts dwarfed the server and the Processing code, and generated bitmaps from fonts. Convert cad to usd Afterwards, it would produce the point trail needed to draw letters out based on an input string. Gender inequality research paper We thought we would support multiple fonts, but the low resolution and the conversion process meant it only saved us the effort of drawing out all the alphanumeric characters by hand.

I’ve cleaned the server code up a bit and posted it on GitHub. Pound dollar exchange rate today Once the rest of the code is in reasonable condition, I’ll link the other repositories. How does the oil futures market work Future employers, I apologies for this, but it was written in 24 hours with little sleep (I did end up sleeping – for an hour, on the lobby couches, wrapped in my winter jacket).

We won an honorary mention for being so close to giving up but actually managing to make something work! I guess this could mean the judges thought we couldn’t pull it off and we just surprised them.

All materials are found on open spaces of a network the Internet as freely extended and laid out exclusively in the fact-finding purposes. If you are what lawful legal owner or a product and against its placing on the given site, inform us and we will immediately remove the given material. The administration of a site does not bear responsibility for actions of the visitors breaking copyrights.