Embedded Basics – Squirrel
Embedded software developers are familiar with C/C++ but with the Internet of Things, knowing just these languages is not going to be enough. Learning some Python and/or Java will help round the language skills but another language a developer may want to also consider is Squirrel.
Squirrel syntax is similar to C and Java but it has some of the dynamic features of Python. For example:
local array=[ 1, 2, 3, { a = 10, b = “string” } ];
foreach (i,val in array)
{
::print(“the type of val is”+typeof val);
}
The above code will create an array and then loop through and print the value and type of the array element. Another example perhaps more familiar to C developers is below:
state <- 0;
function blink(){
/* Invert the value of state: */
state = 1 – state;
/* Write current state to ‘led’ (which is pin9) */
led.write(state);
}
The above code creates a global variable state, assigns it an initial value of 0. The remainder of the code defines a function that modifies the variable state and writes that state to an LED.
Squirrel allows for developers to write object oriented software, taking advantages of classes, inheritance and polymorphism. The language is light weight and script like which allows it to be used in IoT type applications. The language is even used by the Electric Imp platform to provide secure cloud connections to embedded systems.
Squirrel may be another tool that developers want to experiment with in order to understand its advantages and disadvantages as we enter the era of connected devices.
Struggling to keep your development skills up to date or facing outdated processes that slow down your team, raise costs, and impact product quality?
Here are 4 ways I can help you:
- Embedded Software Academy: Enhance your skills, streamline your processes, and elevate your architecture. Join my academy for on-demand, hands-on workshops and cutting-edge development resources designed to transform your career and keep you ahead of the curve.
- Consulting Services: Get personalized, expert guidance to streamline your development processes, boost efficiency, and achieve your project goals faster. Partner with us to unlock your team's full potential and drive innovation, ensuring your projects success.
- Team Training and Development: Empower your team with the latest best practices in embedded software. Our expert-led training sessions will equip your team with the skills and knowledge to excel, innovate, and drive your projects to success.
- Customized Design Solutions: Get design and development assistance to enhance efficiency, ensure robust testing, and streamline your development pipeline, driving your projects success.
Take action today to upgrade your skills, optimize your team, and achieve success.
