danjperron
Posts: 3502
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: hcsr-04 how to fixed string

Sun Feb 02, 2014 2:50 pm

This a always the way that any electronic device should do . No power no lights. ???
You are too concise in your answer. No Explanation. A yes and no answer won't help.

What about the software code.

Start Fresh ! Do a backup of your SD card and use a fresh raspbian. And follow the step by step software how to and be sure that the electric connection are ok.

And show us your step. No just "it doesn't work".

Daniel

User avatar
Onira
Posts: 233
Joined: Tue Oct 02, 2012 6:24 pm
Location: Poland

Re: hcsr-04 how to fixed string

Sun Feb 02, 2014 3:35 pm

ok
I took another SD card and wrote the latest raspbian (2014-01-07-wheezy-raspbian)
booted, did apt-get update & apt-get upgrade & rpi-update
then after a reboot I commented the spi-bcm2708 in /etc/modprobe.d/raspi-blacklist.conf and rebooted
I checked the connections... are OK
next I followed the how-to and installed all the packages

Code: Select all

pi@raspberrypi ~ $ sudo apt-get install git-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
git-core is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi ~ $ git clone git://git.drogon.net/wiringPi
Cloning into 'wiringPi'...
remote: Counting objects: 599, done.
remote: Compressing objects: 100% (541/541), done.
remote: Total 599 (delta 425), reused 96 (delta 58)
Receiving objects: 100% (599/599), 233.09 KiB, done.
Resolving deltas: 100% (425/425), done.
pi@raspberrypi ~ $ cd wiringPi/
pi@raspberrypi ~/wiringPi $ ./build
wiringPi Build script
=====================


WiringPi Library
[UnInstall]
[Compile] wiringPi.c
[Compile] wiringSerial.c
[Compile] wiringShift.c
[Compile] piHiPri.c
[Compile] piThread.c
[Compile] wiringPiSPI.c
[Compile] wiringPiI2C.c
[Compile] softPwm.c
[Compile] softTone.c
[Compile] mcp23008.c
[Compile] mcp23016.c
[Compile] mcp23017.c
[Compile] mcp23s08.c
[Compile] mcp23s17.c
[Compile] sr595.c
[Compile] pcf8574.c
[Compile] pcf8591.c
[Compile] mcp3002.c
[Compile] mcp3004.c
[Compile] mcp4802.c
[Compile] mcp3422.c
[Compile] max31855.c
[Compile] max5322.c
[Compile] sn3218.c
[Compile] drcSerial.c
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]

WiringPi Devices Library
[UnInstall]
[Compile] ds1302.c
[Compile] maxdetect.c
[Compile] piNes.c
[Compile] gertboard.c
[Compile] piFace.c
[Compile] lcd128x64.c
[Compile] lcd.c
[Compile] piGlow.c
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]

GPIO Utility
[Compile] gpio.c
gpio.c:85:12: warning: ‘decodePin’ defined but not used [-Wunused-function]
[Compile] extensions.c
[Compile] readall.c
[Link]
[Install]

All Done.

NOTE: This is wiringPi v2, and if you need to use the lcd, Piface,
  Gertboard, MaxDetext, etc. routines then you must change your
  compile scripts to add -lwiringPiDev

pi@raspberrypi ~/wiringPi $ cd ..
pi@raspberrypi ~ $ git clone git://github.com/linupi/RaspPiTouchLCD.git
Cloning into 'RaspPiTouchLCD'...
remote: Reusing existing pack: 41, done.
remote: Total 41 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (41/41), 41.16 KiB, done.
Resolving deltas: 100% (13/13), done.
pi@raspberrypi ~ $ cd RaspPiTouchLCD/
pi@raspberrypi ~/RaspPiTouchLCD $ ./build
compiling helloWorld.c
run with sudo ./helloWorld
compiling geometry.c
run with sudo ./geometry
compiling images.c
run with sudo ./images
compiling touch.c
run with sudo ./touch
compiling touch_calibration.c
run with sudo ./touch_calibration
pi@raspberrypi ~/RaspPiTouchLCD $ gpio load spi
pi@raspberrypi ~/RaspPiTouchLCD $ sudo ./helloWorld
pi@raspberrypi ~/RaspPiTouchLCD $
and no text appears on the display

but... I don't know what to do with the

Code: Select all

NOTE: This is wiringPi v2, and if you need to use the lcd, Piface,
  Gertboard, MaxDetext, etc. routines then you must change your
  compile scripts to add -lwiringPiDev
add it? where?
Cogito ergo sum

danjperron
Posts: 3502
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: hcsr-04 how to fixed string

Sun Feb 02, 2014 7:24 pm

I suppose that you need to add the wiringPiDev library

add into ~RaspiTouchLCD/build the "-l wiringPiDev" on each line containing "-l wiringPi"


Code: Select all

cd
cd RaspiTouchLCD
nano build

Code: Select all

# Compile helloWorld.c
echo 'compiling helloWorld.c'
gcc -std=gnu99 helloWorld.c lib/lib_PD161704A.c  -o helloWorld  -I /usr/local/include -L /usr/local/lib -l wiringPi -l wiringPiDev
echo 'run with sudo ./helloWorld'
Daniel

User avatar
Onira
Posts: 233
Joined: Tue Oct 02, 2012 6:24 pm
Location: Poland

Re: hcsr-04 how to fixed string

Sun Feb 02, 2014 7:38 pm

Code: Select all

$ ./build
compiling helloWorld.c
./build: line 6: -l: command not found
run with sudo ./helloWorld
compiling geometry.c
./build: line 12: -l: command not found
run with sudo ./geometry
compiling images.c
./build: line 18: -l: command not found
run with sudo ./images
compiling touch.c
./build: line 24: -l: command not found
run with sudo ./touch
compiling touch_calibration.c
./build: line 30: -l: command not found
run with sudo ./touch_calibration
$
Cogito ergo sum

danjperron
Posts: 3502
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: hcsr-04 how to fixed string

Sun Feb 02, 2014 7:42 pm

Obviously you wrote something wrong

Code: Select all

pi@Pi2 ~/RaspPiTouchLCD $ cat ./build
#!/bin/bash

# Compile helloWorld.c
echo 'compiling helloWorld.c'
gcc -std=gnu99 helloWorld.c lib/lib_PD161704A.c  -o helloWorld  -I /usr/local/include -L /usr/local/lib -l wiringPi -l wiringPiDev
echo 'run with sudo ./helloWorld'

# Compile geometry.c
echo 'compiling geometry.c'
gcc -std=gnu99 geometry.c lib/lib_PD161704A.c  -o geometry  -I /usr/local/include -L /usr/local/lib -l wiringPi -l wiringPiDev
echo 'run with sudo ./geometry'

# Compile images.c
echo 'compiling images.c'
gcc -std=gnu99 images.c lib/lib_PD161704A.c lib/bmpLoad.c  -o images  -I /usr/local/include -L /usr/local/lib -l wiringPi -l  wiringPiDev
echo 'run with sudo ./images'

# Compile touch.c
echo 'compiling touch.c'
gcc -std=gnu99 touch.c lib/lib_PD161704A.c lib/lib_XPT2046.c  -o touch  -I /usr/local/include -L /usr/local/lib -l wiringPi -l wiringPiDev
echo 'run with sudo ./touch'

# Compile touch_calibration.c
echo 'compiling touch_calibration.c'
gcc -std=gnu99 touch_calibration.c lib/lib_PD161704A.c lib/lib_XPT2046.c  -o touch_calibration  -I /usr/local/include -L /usr/local/lib -l wiringPi -l wiringPiDev
echo 'run with sudo ./touch_calibration'

Code: Select all

pi@Pi2 ~/RaspPiTouchLCD $ ./build
compiling helloWorld.c
run with sudo ./helloWorld
compiling geometry.c
run with sudo ./geometry
compiling images.c
run with sudo ./images
compiling touch.c
run with sudo ./touch
compiling touch_calibration.c
run with sudo ./touch_calibration
Daniel

User avatar
Onira
Posts: 233
Joined: Tue Oct 02, 2012 6:24 pm
Location: Poland

Re: hcsr-04 how to fixed string

Sun Feb 02, 2014 8:02 pm

I forgot to place a spacebar, corrected and compilled without errors but after a reboot

Code: Select all

pi@raspberrypi ~ $ cd RaspPiTouchLCD/
pi@raspberrypi ~/RaspPiTouchLCD $ gpio load spi
pi@raspberrypi ~/RaspPiTouchLCD $ sudo ./helloWorld
pi@raspberrypi ~/RaspPiTouchLCD $
nothing appears on the screen again
Cogito ergo sum

danjperron
Posts: 3502
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: hcsr-04 how to fixed string

Sun Feb 02, 2014 8:35 pm

Maybe something wrong in the wiring.

Let's recap.

You have two types of display and none of them works.

One is a standard 4/8 bits 2 x16 LCD and all codes available, (wiringPi and python code), don't work.

The second one is a TFT graphic display and it doesn't work either. Is the touch screen parts working?


You will have to go deeper and check the signal. Oscilloscope ?

Daniel

User avatar
Onira
Posts: 233
Joined: Tue Oct 02, 2012 6:24 pm
Location: Poland

Re: hcsr-04 how to fixed string

Sun Feb 02, 2014 8:41 pm

16x2 works with the simple script on adafruit learning page, shows date and IP
the TFT LCD from waveshare works on the image from waveshare (examples) but I just want it to use with my raspbian im using with all stuff I have there.

idk why it doesn't work on the clean raspbian :(


checked wirings again... are all ok as shown on the HOW-TO




I have this from the reseller of the display, check it please http://arduinosolutions.com/pl/p/file/2 ... -LCD-A.zip
Cogito ergo sum

danjperron
Posts: 3502
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: hcsr-04 how to fixed string

Sun Feb 02, 2014 9:10 pm

Ok I did look at the zip file but I didn't see anything about the Raspberry Pi code.

AVR , PIC and STM 8 code.


What is that Waveshare image ? Didn't find any link about it.

danjperron
Posts: 3502
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: hcsr-04 how to fixed string

Sun Feb 02, 2014 9:39 pm

The only things I found about the real schematic of the full display is the description of the pin connector.

Both LCD and touch screen use SPI.

Just wonder why you are using the correct code for the display.
I didn't find any source code for this display to run on the Raspberry Pi.

Are you sure that the code "RaspPiTouchLCD" works on that display. The code is for the PD161704A and your display use the BD663474 chip.

I did look at the lcd_init function from "RaspiTouchLcd" and the Waveshare, Pic version, and they are completely different. it is not the same SPI command.

Looks like you will have to convert the cpu source code, AVR or PIC, to have it run on the Rpi.

And this I won't do.
I don't have a display to debug.

User avatar
Onira
Posts: 233
Joined: Tue Oct 02, 2012 6:24 pm
Location: Poland

Re: hcsr-04 how to fixed string

Mon Feb 03, 2014 6:51 am

here http://arduinosolutions.com/pl/p/file/2 ... -LCD-A.zip is a zip file which contains a folder Raspberry_Pi_LCD22 and I thought it is for the pi to use with :(
Cogito ergo sum

User avatar
Onira
Posts: 233
Joined: Tue Oct 02, 2012 6:24 pm
Location: Poland

Re: hcsr-04 how to fixed string

Mon Feb 03, 2014 8:12 pm

I can give DVK511 schematic if you want
Cogito ergo sum

Return to “Automation, sensing and robotics”