Help

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help

618 Views
jackmonaghan
Contributor III

pastedImage_0.png

Hello I'm a teenager and need help writing one of my first programs. Any Help is greatly appreciated:)

Ok so I've made a diagram of how the program/(part of the circuit) will be set out

so if you press the button but haven't pulled out the pull out it will play a noise on loop and when you press it

again it will turn off. But if you have taken the pullout out it puts it into an "ACTIVE" mode so as soon as you press

the button it will start playing and won't stop until the batteries die no matter how many times you try to turn it off.

define: GPIO, noise function, speaker function,

1. A low speed voltage is put through both the GPIO outputs.

2. Both the GPIO inputs keep sampling for any input.

3.Outcomes

     A. The "contact" gets an input and the button does as well it will jump to the part of the code where it will just play the noise on loop

     until the batteries die.

     B, Their is an input in the button function but not the "contact" functions it will start playing the code that just plays the noise on loop until the button is pressed again to turn it off

Regards

Jack

0 Kudos
3 Replies

488 Views
EarlOrlando
Senior Contributor II

Hello Jack,

If you don't have any experience on Freescale MCUs I recommend you to get started with processor expert and/or Kinetis SDK​.

The guide Writing my first KSDK1.2 Application in KDS3.0 - Hello World and Toggle LED with GPIO Interrupt is a good document to get started with Kinetis SDK (KSDK).

Do you really need the I2S interface to play the noise sound? If you just need to generate noise you can use an FTM instance as PWM and connect it to a speaker.

The API Reference manual that is located in C:\Freescale\KSDK_1.2.0\doc\Kinetis_SDK_v.1.2.0_API_Reference_Manual.html once you install KSDK show examples and information about the peripherals usage. Also, the folder C:\Freescale\KSDK_1.2.0\examples shows some demos and drivers' examples. Which board are you using?

Best regards,

Earl Orlando.

0 Kudos

488 Views
jackmonaghan
Contributor III

Hello Earl

For the sound part its not like a beep sound its more like a 7 seconds of someone talking type of sound

And I'm using the FRDM-kl43z board

0 Kudos

488 Views
EarlOrlando
Senior Contributor II

Hello Jack,

The MCU MKL43Z256VLH4MCU which is contained in the FRDM-KL43Z is supported by KSDK so I recommend you to take a look into it (which I referenced in my last message). If you have any doubt we can solve it. Please start with the guide to create a new project and you will be able to manage the GPIO inputs and outputs so the only thing that you will need to implement is the I2S interface that is very simple with KSDK, I think that the example C:\Freescale\KSDK_1.2.0\examples\twrk64f120m\demo_apps\sai_demo will be useful for you.

Best regards,

Earl.

0 Kudos