blinky | A blinky LED example for tessel
kandi X-RAY | blinky Summary
kandi X-RAY | blinky Summary
A blinky LED example for tessel
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of blinky
blinky Key Features
blinky Examples and Code Snippets
Community Discussions
Trending Discussions on blinky
QUESTION
I'm currently trying to learn Rust (for embedded specifically), coming from a background of C for embedded systems and Python. So far, I've been reading Rust Programming Language and Rust for Embedded, and read a few blog posts on the web.
I want my first project to be a simple "Blinky", where an LED blinks infinitely. I've got an STM32L152CDISCOVERY board with an STM32L152 chip in it (basically same as STM32L151), which is a Cortex M3.
Instead of implementing everything from scratch, I want to leverage existing crates and HALs. I've found two that seem promising: stm32l1 and stm32l1xx-hal. I've tried to read the documentation of each of them and also part of the source code, but I still can't figure out how to use them correctly.
Got a few questions about Rust and about the crates:
I see that
stm32l1xx-hal
has a dependency onstm32l1
. Do I need to add both as a dependency in myCargo.toml
file? Or will that create problems related to ownership?Is this the correct way to add them? Why is the second one added like that
...[dependencies.stm32l1]
?
ANSWER
Answered 2021-May-29 at 19:32I got some help from a Discord community. The answers were (modified a bit by me):
stm32l1xx-hal
already depends onstm32l1
as seen here. There's no need to import it twice. It is enough to add to Cargo.toml:
QUESTION
I am working on an embedded rust project using msp430 controllers (MSP430G2553 - LaunchPad).
I have boilerplate code up and running from the msp430 quickstart repo
However, for my project, I need to run hmac, so I found a no_std
compatible crate. I have tried roughly 10 other crates as well without luck.
I believe I need to specify some flags for the linker, but I do not know which I am missing. I currently have rust the following rustflag set in .cargo/config
:
ANSWER
Answered 2021-Mar-17 at 13:05It seems that you are linking to the wrong memory spec file.
I would recommend to ensure that this file exists link-arg=-Tlink.x
, otherwise switch it to the correct file.
Rust embedded named their memory file memory.x, and I assume have followed the steps. So changing the flag to link-arg=-Tmemory.x
should fix it.
QUESTION
I've programmed my STM32F401 in C and Rust but am having a problem with assembly.
- When I initially load the code with a Black Magic Probe, it runs fine
- When my board powers up or is reset, the code doesn't run.
- After reset, in GDB, if I try to Continue it, it throws an exception.
- After reset, in GDB, if I try to Run it, it runs fine
The actual code in the reset handler is the perennial "blinky". I'm sure there's no problem with the code, this "smells" of some kind of "initialisation issue"?
- I'm a massive GDB noob, but if I do
info registers
, PC is always the value I'd expect - 0x8000198
ANSWER
Answered 2021-Feb-09 at 19:41 8000004: 08000198 .word 0x08000198
QUESTION
Hey I am currently building a simple pacman in javascript as a learning project. I am able to render a basic board, pacman, pellets and big pellets with basic canvas drawings (arc etc) . The game is responsive to key codes moving pacman around but Imstruggling when I want to test for collision and access x and y values of canvas drawings. My board is drawn in for loop that iterates through a layout/grid 2d array of numbers and draws something different depending on the number, 0 representing walls, 1 - pellets etc. I feel I may be making an error in the drawBoard for loop also.. I have started to go back and forth between using a function to draw walls and then trying to access its X and Y positions:
...ANSWER
Answered 2021-Jan-26 at 12:56In pacman collision can be oversimplified by just using an array and checking wether the current case where pacman is contains something or not, if so make him return to previous position.
QUESTION
A number of students + myself have been attempting to set up a Zephyr RTOS build environment under Windows 10, to build applications that target various ARM Cortex M boards. We have each followed the Zephyr "Getting Started Guide" and ran into the same problem. When compiling for a number of different boards (let's just use the nrf52840dk_nrf52840 as an example here) we get this error:
Error Message
...ANSWER
Answered 2020-Nov-25 at 01:01After some digging and receiving help from others in the zephyr-rtos slack channel, I have found others experiencing the same problem, so I'll post my fix here in the hope that it solves other people's issues as well.
The fix is twofold:
- You must downgrade from CMake 3.19. Most before this work, but 3.17.2 was the recommended version. If you're using windows, this can be done with the chocolatey command:
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' --version 3.17.2 --allow-downgrade --force
. - You must remove the .cache folder. Your previous build output tells you where this will be stored. The line starts with like: "-- Cache files will be written too: ..."
I still don't know why this error gets thrown, or what should be done to fix it permanently, but this is a fix for now.
QUESTION
I am getting into learning embedded systems and I tried to implement blinky but the software delay gets skipped for some reason. I was expecting it to blink when I am pushing the button but instead the LEDs kept on.
Code I have used is shown below,
...ANSWER
Answered 2020-Jun-30 at 13:07Either specify -O0 as optimization flag in the compiler settings to avoid that the useless loop (from the compiler point of view) is optimized away. Alternatively check the MDK or BSP for a provided delay() function known to work.
QUESTION
Hi I'm trying to run the getting started guide, but I'm having issues, I'm currently on the zephyr directory and I want to run the example, so I try west build -p auto -b qemu_x86 samples/basic/blinky
but it gives instead
ANSWER
Answered 2020-Jun-18 at 09:35The error is caused by an outdated DTC version. Either update or use the one in the SDK installation:
QUESTION
I have this simply blinky.c
code for AVR
microcontrollers. It compiles and run no problem. But Intellisense in my vscode is going kinda crazy
ANSWER
Answered 2020-Jun-13 at 12:26Okay, I found a solution. It is caused by the internals of the avr/io.h
files. It includes a certain file with definitions based on #define
of a given microcontroller in the source code. So when I do not specify the controller it won't #include
it in io.h
therefor it is not visible to IntelliSense, but compilation can see it because I specify it. So in order to make io.h
include definitions we need. We have to tell it which controller we will be using. Like that:
QUESTION
I'm relatively new to programming microcontrollers, so I started experimenting on an ATtiny85.
First program was simply turning on an LED and off with a little delay (classic blinky program).
Now I wanted to slowly increase the brightness of the LED. Here is the code:
...ANSWER
Answered 2020-May-01 at 18:12__delay_ms()
is converted to cycle-wasting instructions by the compiler, so as long as your F_CPU
matches the current speed of the processor, then it should work as expected.
I would look for other places in your code that are not working as you expect them to.
A half second delay at power up is not a great diagnostic test since it happens quickly, only once, and there may be other things going on then as well.
Maybe instead try blinking between two different brightness levels with a 500ms delay between. Visually this should be unambiguous.
if that works as expected, then maybe try doing a brightness ramp and changing the delay inside the loop to see if that works as expected.
Eventually you will work your way up to something that is not as expected, and then you will know where the problem is. It is still possible you will not understand what is going on, but at least you will be able to ask a much more specific question here and be more likely to get a helpful answer.
Report back with your results!
QUESTION
I have two nucleo boards (F4339ZI and F303K8) and neither of them show up as USB devices when I plug them into a computer via the USB port (CN1 - the USB micro port on the ST-Link, not the USB port for the board itself).
I have tried multiple host USB ports, with and without a USB hub, across two different computers, one running OS X and one running Linux. I have tried at least 6 different cables. The OSX machine is using a USB-C to USB-A converter (if that's the correct terminology). The Linux machine has USB-A ports.
In no case does the device show up using lsusb
under Linux or system_profiler SPUSBDataType
under OSX. Needless to say STM32CubeIDE and st-info can't see the boards. Other USB devices are functional.
The COM LED is slow blinking red which the manual (https://www.st.com/resource/en/user_manual/dm00244518-stm32-nucleo144-boards-stmicroelectronics.pdf) says means USB enumeration hasn't completed (matching what is seen from the OS level).
The boards successfully run their factory supplied blink programs when powered on. I have tried (with the F4395I) moving JP3 to VIN so the board doesn't power up which should just leave the ST-Link running - still no enumeration though.
I tried connecting to a USB charger with JP1 off (and JP3 on U5V) and the board powers up and blinky runs. The manual referenced above says:
In case the board is powered by a USB charger, there is no USB enumeration, so the green LED LD6 stays in OFF state permanently and the target STM32 is not powered.
But everything works for me - LD6 goes a steady green as it does when connected to a computer.
Given it happens with multiple computers, OSs, cables and Nucleo boards I assume the error lies with me, the common factor in all the tests. This is my first use of Nucleo boards so I may well have a mis-assumption.
...ANSWER
Answered 2020-Mar-23 at 23:07Out of frustration and lacking anything else to try I dug up every micro USB cable I could find. One had chokes on each end and magically, using that cable, everything just works as expected.
Can it be that I have at least 10 broken USB cables? I don't have an easy way to test them but I guess they might not have the data lines wired to save cost if manufacturers assumed people would only charge phones with them. I don't recall where they all came from...they have just accumulated in a box of USB cables.
Perhaps the Nucleo board sensitive to some horrible interference floating around my room?
Sorry for the noise! Broken cable was genuinely one of the things I suspected - but not 6 of them...
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install blinky
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page