Posts with «arduino» label

Visual Development with XOD

Early programmers had to represent code using binary, octal, or hex numbers. This gave way quickly to representing programs as text to be assembled, compiled, or interpreted by the computer. Even today, this remains the most common way to program, but there have been attempts to develop more visual ways to create programs graphically. If you program microcontrollers like the Arduino, you should check out XOD and see how you like visually creating software. The software is open source and currently, can target the Arduino or Raspberry Pi.

You can launch the IDE in a web browser or download a local copy. You transfer nodes from a palette into a grid-like workspace. These nodes might be inputs, outputs, processing blocks, or represent real-world I/O devices. Nodes have inputs and outputs of specific types and you connect them together, connecting like types only, although there are blocks that can convert.

For example, to the right is a simple set of nodes that forms the prototypical flashing LED program. A clock node creates a pulse that toggles a memory element and a digital output accepts both the signal and a constant value indicating which port it represents.

This is a simple example, but it does show the intuitive flow of joining nodes. There is a reasonable array of node types and sufficient documentation.

There are out-of-the-box nodes for ultrasonic sensors, temperature sensors, servos, LCDs, buttons, and H-bridges. You can create your own super-nodes (patches) and you also can make multiple disjointed flows to execute more than one task at a time.

When you generate the code you get a lot of boilerplate that sets up the run time system and the nodes you use. Your main code appears to be in an evaluate function. For example, here’s a snippet of the code that corresponds to the simple graphical blink program:

void evaluate(Context ctx) {
State* state = getState(ctx);
TimeMs tNow = transactionTime();
TimeMs dt = getValue<input_IVAL>(ctx) * 1000;
TimeMs tNext = tNow + dt;

if (isInputDirty<input_RST>(ctx)) {
if (dt == 0) {
state->nextTrig = 0;
clearTimeout(ctx);
} else if (state->nextTrig < tNow || state->nextTrig > tNext) {
state->nextTrig = tNext;
setTimeout(ctx, dt);
}
} else {
// It was a scheduled tick
emitValue<output_TICK>(ctx, 1);
state->nextTrig = tNext;
setTimeout(ctx, dt);
}
}

There are a few rough edges, which isn’t surprising for new software. For one thing, nodes have fixed numbers of inputs and outputs. So if you want, for example, a ten-input AND gate, you’ll have to build it. Another apparent issue is there is no way we found to select a lot of items at once. If you decide you want to move a whole bunch of nodes down to make room for something new, you are going to be in for a lot of work.

There are other drag-and-drop programming languages, of course. We’ve covered Scratch for the Arduino and the Raspberry Pi, before. However, this is a dead simple way to try flow-based programming with minimal setup.


Filed under: Arduino Hacks, Raspberry Pi

An Arduino-powered backlit Clemson Tiger Paw

Most people support their school or favorite sports team by buying a shirt or tuning into games. Jacob Thompson, however, took things one step further and created his own Arduino-powered, backlit Clemson Tiger Paw.

Thompson’s “WallPaw,” as he calls it, uses an Arduino Uno to receive signals from an infrared remote and to pick up sounds with a small microphone. This information is passed on to an Arduino Mega, which controls a five-meter-long strip of WS2812 LEDs to provide lighting effects.

He notes that it would be possible to use only one Arduino board for everything, but patterned his code after this tutorial that included two. The paw itself is cut out of wood and clear acrylic, allowing the lights underneath to shine through nicely.

You can see the build in action below and find more details on Thompson’s website here.

Build an arcade-style hoops game with Arduino and LEGO

You may be familiar with “Pop-A-Shot” at arcades and amusement parks, which allows you to shoot baskets at a hoop for fun and prizes. This Maker, apparently unsatisfied with not having one of these at home, decided to duplicate the game with the “Pop o Shop.”

In this version, an ultrasonic sensor in the hoop tells an Arduino Nano when a shot has been registered, while two 7-segment displays inside of a LEGO scoreboard show the current count, time remaining, and high score. There is also an RGB LED that turns green after every made basket and changes color with a new top score.

Incidentally, one of the displays can also spell out “POPOSHOP,” which dictated the name of the game, since there is no “T” character in the LedControl library used! For more info and code, be sure to check out the “Internet of LEGO” build log!

CircuitPython Snakes its Way onto Adafruit Hardware

We sit down to talk with Scott Shawcroft, an engineer at Adafruit, to discuss their hardware transition to CircuitPython.

Read more on MAKE

The post CircuitPython Snakes its Way onto Adafruit Hardware appeared first on Make: DIY Projects and Ideas for Makers.

CircuitPython Snakes its Way onto Adafruit Hardware

We sit down to talk with Scott Shawcroft, an engineer at Adafruit, to discuss their hardware transition to CircuitPython.

Read more on MAKE

The post CircuitPython Snakes its Way onto Adafruit Hardware appeared first on Make: DIY Projects and Ideas for Makers.

An Arduino fidget spinner arcade controller

Apparently unsatisfied with existing video game input devices, game designer Rob Santos created his own using, what else, fidget spinners. His system combines a spinner and five buttons on a pair of controllers to interface with Flock Off, an arcade game loosely based on Flappy Bird.

To register spinner input, a magnet is embedded on each lobe, triggering a Hall effect sensor three times per revolution when spun. An Arduino in each control box reads these signals, then sends this information, along with button inputs, to the game via USB accessible through a serial port.

Although using the Uno means that the game must be programmed especially for this type of input, Santos notes that using an HID-capable board, such as the Leonardo, would give it the capability to act as keyboard input by itself.

Create an interactive laser sheet generator with Arduino

What’s better than a laser? How about two rapidly rotating lasers, attached to servo motors and controlled by an Arduino Mega? That’s exactly what Jon Bumstead made with his “Interactive Laser Sheet Generator.”

In addition to controlling the lasers, his device can sense hand motion on top of it using an array of 12 ultrasonic sensors, and can even coordinate music through a built-in MIDI output.

As seen in the demonstration video, Bumstead’s project–which was constructed with the help of a CNC router–looks like a cross between a coffee table and a test fixture for a space vehicle. When activated, a brushless motor spins the two lasers at a high speed, while the Mega controls the laser angles via two servos, creating a unique vortex-like light show!

I included distance sensors in the device so that the laser sheets could be manipulated by moving your hand towards them. As the person interacts with the sensors, the device also plays music through a MIDI output. It incorporates ideas from laser harps, laser vortexes, and POV displays. The instrument is controlled with an Arduino Mega that takes in the inputs of ultrasonic sensors and outputs the type of laser sheet formed and music generated. Due to the many degrees of freedom of the spinning lasers, there are tons of different laser sheet patterns that can be created.

You can find more details on the laser sheet generator on Instructables.

UNLEASH your creativity for the greater good!

**To the members of the Arduino community interested in social innovation and tech for the greater good, this is a call for your help.**

Almost a year ago I was awarded with an Ashoka Fellowship, which got me to join a group of people working with projects all over the world having to do with social change through entrepreneurship. Issues covered by the Ashoka fellows range from gender equality, passing by collaborative economy, democratic access to all sorts of material resources, and ending with education using technology.

I have always been engaged in different social initiatives in my life: helped creating two Scout groups, joined several student associations (became president of one), played in a band (sorry we’re not on Spotify), taught martial arts to kids with visual impairments… and helped create the largest community dedicated to open hardware in the history of technology (so far).

During the last 10+ years I have been focused in building the Arduino platform, but also in reaching out to other communities, including arts, design, and more recently, education. Therefore, the Ashoka Fellowship feels like the perfect fit to encourage me to continue to be engaged with the development of our platform by making it more accessible to others.

(For those interested, the Ashoka Fellowship got me and Arduino to collaborate with the PUIG Foundation in helping Spanish speaking teachers to realize some of their educational tools, but that is material for a different blog post.)

The role of the Arduino founders is, among other things, engaging with the community in trying to improve the platform, but also society in general. Not in vain, we work with open source, use open tools and create open content. In the past, thanks to the Arduino community, we have translated the Arduino IDE and the Arduino reference to multiple languages, added features to the software (also some bugs), or corrected errors on the website. With this post, I (we) want to invite the Arduino community to engage in a larger effort for the greater good. Something that can help shaping the future of how technology engages in making the world a better place.

This year (as a matter of fact, starting next week) Arduino will be working with UNLEASH in an effort to help them accomplish their goals through the innovative use of our platform. From August 13th to 21st, 2017, Denmark will host the first UNLEASH event, where 1,000 top talents from 129 countries are going to meet to create innovative solutions to challenges within the UN’s Sustainable Development Goals (SDGs). The talent pool draws from tech entrepreneurs, leading academics, and young development program officers. This year, talents will co-create solutions focusing on seven SDG-related themes: health, food, water, education & ICT, energy, urban sustainability, and sustainable consumption & production.

Over the nine days, the participants will work to create real, scalable solutions to the Sustainable Development Goals. The UNLEASH event has made a call for young talent and can only host 1,000 volunteers, but we want to augment their ability to share and collaborate online. Arduino has created a channel on the Arduino Forum named “UNLEASH 2017” where we invite all of you to participate in the online discussion to help those participating on site with possible technical challenges they may face. The channel will be open for as long as the collaborations go on. We expect some interesting projects to emerge, where some of the Arduino community members may even team up with those attending the event IRL.

Personally, I will be hosting an open seminar online (URL to be announced) on August 16th at 5pm CET to help the participants–but also anyone interested–in getting started with the use of Arduino tools. I will highlight examples of projects using Arduino, and there will be some time for questions via a chat. Later, I will follow the Arduino Forum and help with the moderation of the conversations happening there. I would love to see some of you there as well!

ATMega328 3D!

Small OLED displays are inexpensive these days–cheap enough that pairing them with an 8-bit micro is economically feasible. But what can you do with a tiny display and not-entirely-powerful processor? If you are [ttsiodras] you can do a real time 3D rendering. You can see the results in the video below. Not bad for an 8-bit, 8 MHz processor.

The code is a “points-only” renderer. The design drives the OLED over the SPI pins and also outputs frame per second information via the serial port.

As you might expect, 3D output takes a good bit of math, and the chip in question isn’t very good at handling real numbers. [Ttsiodras] handles this using an old technique: fixed point arithmetic. The idea is simple. Normally, we think of a 16-bit word as holding unsigned values of 0 – 65535. However, if you choose, you can also use it to represent numbers from 0-50.999, for example. Mentally, you scale everything by 1,000 and then reverse the operation when you want to output. Addition and subtraction are straightforward, but multiplication and division require some extra work.

If you want to read more about fixed point math, you are in the right place. We’ve also covered a great external tutorial, too. But if you think this is the first time we’ve covered a 3D graphics engine for the ATmega parts, you’re wrong.


Filed under: Arduino Hacks

Maker Pro News: The Maker Pros of DEF CON, Shakeup at Arduino, and More

This past week, maker professionals learned about new security measures for their projects and found solace in Arduino's new leadership.

Read more on MAKE

The post Maker Pro News: The Maker Pros of DEF CON, Shakeup at Arduino, and More appeared first on Make: DIY Projects and Ideas for Makers.