Accelerometer, Compass and Distance Sensor Project - HELP

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 Hello Everyone,

   

I'm trying to learn about PSoC 3, and I want to show in the LCD the values measured of the accelerometer, compass and distance sensor.

   

Both distance sensor and compass have digital outputs.

   

I've been searching in the internet and found this project done (http://www.planetpsoc.com/psoc1-projects-analog/22-measure-multiple-analog-inputs-using-analog-mux-b...), although I can't compile it because there are an error I don't know how o solve.

   

Please, can anyone help me?

   

 

   

 

   

 

   

The accelerometer has 2 outputs(X and Y) and it's analog.

0 Likes
15 Replies
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

I compiled under Imagcraft, Designer 5.2, compiled fine with one minor

   

warning.

   

 

   

Note I was asked to update 2 modules and I gave it permission, update

   

was successful.

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

Note, this was a PSOC 1 design by the way. So compile and IDE was

   

Designer, not Creator (PSOC 3/5).

   

 

   

Project was analog mux buss for multiple sensors.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 Thanks Dana.

I need a PSoC 3 project any suggestion?

0 Likes
Anonymous
Not applicable

 I had done the project attached, but It's not working, can you take a look?

 

0 Likes
Anonymous
Not applicable

 Sorry, attached now.

The project for the accelerometer.

0 Likes
Anonymous
Not applicable

 I couldn't attach a file...

My project, with accelerometer, has two inputs->Analog Mux->ADC DelSig->LCD.
Following my code, please take a look:

   

*/

   

#include <device.h>

   

#include <stdio.h>

   

#include <stdlib.h>

   

#define TAM 16

   

void main(){

   

uint8 mux=0;

   

char8 buffer[2][TAM];

   

Multiplex_Start();

   

Multiplex_Init();

   

ADC_Start();

   

LCD_Start();

   

    ADC_StartConvert();

   

LCD_Position(0, 0);

   

LCD_PrintString("Acelerometro");

   

while(1){

   

mux=!mux;

   

if(ADC_IsEndConversion(ADC_WAIT_FOR_RESULT)){

   

sprintf((char *)buffer[mux],"%f",ADC_GetResult16());

   

LCD_Position(1, 0);

   

LCD_PrintString(buffer[0]);

   

LCD_Position(1, 8);

   

LCD_PrintString(buffer[1]);

   

        }

   

}

   

}

0 Likes
Anonymous
Not applicable

 @rcmarques for accelerometer project u can refer  to sample projects that comes with the psoc guide and in psoc creator 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The PSoC5 FirstTouch kit (-14) has in its example projects some which use the on-board accelerometer. The switch from PSoC5 to PSoC 3 is rather easy. I suggest to download the project-files from here http://www.cypress.com/?rID=43674 

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 Thanks guys!

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You are always welcome!

   

 

   

Bob

0 Likes
Anonymous
Not applicable

@bob i think PSoC 5 First touch starter kit is now obselete according to cypress website so go for PSoC 003 first touch starter kit and develop projects on it

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

As a real "Start" the FirstTouch modules come in very handy. But they go out (obsolete) quickly as well, undergoing re-designs and whatever else.

   

To constantly beeing on the developer's side I would recommend a -001 or a -30 kit and providing the external hardware on a separate board connected to the kit. There is a Video from Dave van Ess (called "Pimp your Kit" one of the first PSoC Today episodes) which shows up how to improve a -30 kit, have a look at!

   

 

   

Bob

0 Likes
Anonymous
Not applicable

plz send me link for Pimp your kit webisode

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Here http://www.cypress.com/?rID=60521 is a list of all PSoC today Webisodes. Take the very first one.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

PSOC 3 First Touch still an active product sold, and has the accelerometer on it.

   

 

   

Regards, Dana.

0 Likes