choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 8:22 am

I think this is going to take a while like this while i am happy to do this i think it might be something fundamental i am doing wrong especially as we are noobs. I would suggest as above treat us like children and go for an abc approach. One of our other projects didnt work because my son pulled th wrong resistor out of our supplies (took us 4 days to solve that one)

User avatar
rpdom
Posts: 15897
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Screaming jellybaby programming

Thu Dec 31, 2015 8:34 am

As I said before, careful typing is essential. Copy and paste is good.
There is a big difference between

Code: Select all

omxplayer -o hdmi burp.wav
(which is correct) and

Code: Select all

omxplayer -0 hdmi burp.wav
or even

Code: Select all

omxplayer -O hdmi burp.wav
both of which are wrong.

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 9:36 am

I see its just something small making the difference i thought it would be
That correct one with the dash at the top of the letter/number where do i find that symbol on my keyboard i have pressed the shift key and tried every button do i need to reconfigure my keyboard?

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 10:12 am

OK... for a CHILD...

You type something in to the terminal screen (after the $ - the rest is the directory that you are currently looking at). Everything at the start of the line is called the 'prompt' or 'bash prompt'. Usually the prompt is not included in things that you type, as it is (or can be) different for everybody. So,

Code: Select all

pi@raspberry.pi ~ $
This shows the user (pi), the name of the machine (raspberry.pi), the current directory (~) and the end-of-prompt 'marker' ($). There are spaces between some of them. When the current directory shows ~ it means your 'home' (or default) directory, which is /home/pi.

Code: Select all

pi@raspberry.pi ~/jellybaby $
This is the same prompt as above, but shows that your current directory is now a sub-directory of your home directory.

When you type something at the prompt the bash program checks what you have typed to work out what to do. The first word (letters up to the first space) is usually the 'command' that is either a built-in command that bash always knows about, or the name of a program file that bash 'finds' on your system, omxplayer is the name of a program. What follows the command can be 'options' that modify what the command does, usually starting with a '-' (a bit like "run" is a command, and "run quick" gives an extra option to the run command). Your error message states "invalid option", probably because you should have typed a 'o' (little 'Oh') but you typed a '0' (zero). That option is telling omxplayer where to send the sound (the 'o'utput). Following the options are 'parameters' that are the things that the command operates on, in this case your sound file burp.wav

Now, back to the first point. The sound file is given as burp.wav. That means it must be in the current directory, which in this case should be /home/pi/jellybaby or ~/jellybaby (they are both the same place). If you are at the ~ prompt you will need to tell omxplayer that the file you need to use is jellybaby/burp.wav as the sound file is in the jellybaby sub-directory.

You should probably spend some time learning the bash commands such as cd, ls, cp, cat and less so you can navigate round your files using the terminal. Check the help page here: https://www.raspberrypi.org/documentati ... /README.md
Last edited by Navyscourge on Fri Jan 01, 2016 2:31 pm, edited 1 time in total.

User avatar
rpdom
Posts: 15897
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Screaming jellybaby programming

Thu Dec 31, 2015 10:41 am

choice.locks wrote:I see its just something small making the difference i thought it would be
That correct one with the dash at the top of the letter/number where do i find that symbol on my keyboard i have pressed the shift key and tried every button do i need to reconfigure my keyboard?
What dash at the top of the letter/number?

The "-o" is just a dash/minus followed by a lower case letter "O". It's not a number. just "o" as in "oh dear!".

User avatar
DougieLawson
Posts: 36829
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Screaming jellybaby programming

Thu Dec 31, 2015 10:47 am

The tilde (~) is not shorthand for "current directory", it's shorthand for your home directory (as set with the HOME= environment variable).

So with HOME=/home/pi then ~/foo == /home/pi/foo
You can see your environment variables with a plain export command or by running the env (/usr/bin/env) command.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 10:49 am

Struggling to type that raised hyphen symbol where do i find this symbol on the keyboard i have tried shift key and every other key but cant find it.

User avatar
rpdom
Posts: 15897
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Screaming jellybaby programming

Thu Dec 31, 2015 12:07 pm

choice.locks wrote:Struggling to type that raised hyphen symbol where do i find this symbol on the keyboard i have tried shift key and every other key but cant find it.
There is no such thing as a "raised hyphen".

On pretty much every keyboard I've used recently it is between the 0 (number zero) and the "=" keys. Top right. Keys go "7890-=". Pressing that key gives you "-". Pressing the key with shift gives you "_" (underscore).

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 3:45 pm

Its the newbie again simple question but i cant find it in the instructions can someone say true or false to this statement

1. If your program doesnt work in terminal when you press enter you just continue to type the information again it will not affect the programming you do not need to remove all of the previous text.
True/false

User avatar
DougieLawson
Posts: 36829
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Screaming jellybaby programming

Thu Dec 31, 2015 3:55 pm

choice.locks wrote:Struggling to type that raised hyphen symbol where do i find this symbol on the keyboard i have tried shift key and every other key but cant find it.
What country are you in? Have you configured your RPi for your locale, your keyboard and your timezone?

If you get 100% stuck take a photo of your keyboard, upload it to http://imgur.com and post a link to it on here.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 4:55 pm

I am in the uk i think i reconfigured the key board to us but not sure which one it was one of the things i did when we struggled to light and led (referred to earlier wrong resistor in the end)
Can you answer my true false question please as i am worried to much info in terminal

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 6:43 pm

If your program doesnt work in terminal when you press enter you just continue to type the information again it will not affect the programming you do not need to remove all of the previous text.
True/false
Not sure the question actually makes sense... but for the way you have phrased it, I'd say FALSE (it might be easier to understand if you could find a full stop on your keyboard at some point)

The program is trying to do something. If it doesn't work it is unlikely to work next time. I don't understand how you can 'remove all of the previous text', because when you press Enter the Pi acts upon what you have typed and you cannot delete what you typed before, or any output from the program. Hopefully you will get error messages when it does not work, so you should try to understand what those error messages mean and then fix the problem

When you talk about a terminal, do you mean the screen you see after you type the password, i.e. just text, or do you open the terminal from the top menu on the windowed screen / file manager that you get when you type "startx" (or does your Pi automatically log you in and open the windowed screen). Do you know what Operating System you are running? Is it Raspbian?

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 6:49 pm

@ Dougie - I was trying to explain what the prompt was on the screen, and how you can read it to understand what your current directory is - i.e. it is the bit before the '$'. In the example I gave it is '~' which IS the home directory. A later example the current directory shown on the prompt is '~/jellybaby' which is also '/home/pi/jellybaby'. It is really hard trying to cover these issues in bullet-proof simple language ;)

Now I have re-read that post, there is a '$' that should be a '~' - grrrr!

User avatar
DougieLawson
Posts: 36829
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Screaming jellybaby programming

Thu Dec 31, 2015 7:30 pm

Your true/false question depends on what program is reading the keyboard buffer and how it parses your input.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

jbudd
Posts: 1054
Joined: Mon Dec 16, 2013 10:23 am

Re: Screaming jellybaby programming

Fri Jan 01, 2016 12:06 am

If you are typing into a terminal window, which shows you the "dollar prompt" like this

Code: Select all

pi@raspberrypi:~ $
then basically each line is interpreted in isolation. So you do not need to delete the previous commands.

In this example you can see that I have entered several commands, pressing Enter each time. The Pi executes each one without reference to what I previously did, prints any output and returns to the dollar prompt for my next command.
bash.jpg
bash.jpg (43.76 KiB) Viewed 1912 times
My commands were:
1. pwd ("Print Working Directory" - tell me which directory I am currently in.
2. whoami (tell me what my user name is)
3. hostname (tell me the name of this computer)
4. ls (List the files in the current directory)
5. cd Documents (move into the directory called Documents)
6. date (tell me what the system date and time is)

But if you do want to clear away the clutter on your terminal, there is a command to do that. it is clear

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Fri Jan 01, 2016 8:46 am

I think i have got that part now i hope this helps below.
1. I have created a shortcut on the screen for (terminal) thats the black monitor icon and i am double clicking this to start programming.
2. I have a pre loaded sd card as supplied with raspberry pi (i think it has raspbian on it)
3. So i double click on the icon (terminal)
4. It then shows (raspberry pi) as text on screen and i enter coding here.
5. From what i can make out from your postings. The coding as per (jelly baby instructions) has to be entered at each attempt to get this program running. In other words if i didnt get the test burp sound up to this point. Try over and over again in (terminal). To enter the exact instructions. Any previous program typed into terminal window will not effect what i type when i retry to enter the data, providing i have an error message before I try to enter the data again. Could you confirm that this is correct please.

jbudd
Posts: 1054
Joined: Mon Dec 16, 2013 10:23 am

Re: Screaming jellybaby programming

Fri Jan 01, 2016 9:37 am

5. From what i can make out from your postings. The coding as per (jelly baby instructions) has to be entered at each attempt to get this program running. In other words if i didnt get the test burp sound up to this point. Try over and over again in (terminal). To enter the exact instructions. Any previous program typed into terminal window will not effect what i type when i retry to enter the data, providing i have an error message before I try to enter the data again. Could you confirm that this is correct please.
That is what I tried to confirm above, with some extra information for your interest.

If you are typing at the dollar prompt - that is the worksheet section "Sound of a burp" then the answer is Yes. Mostly. As long as it displays the dollar prompt again.

It really is not easy to give you a definite Yes/No answer because the jellybaby worksheet introduces you to both the Bash shell (= "command line" = "dollar prompt") and to stored Python programs.
If you make a mistake when editing a program then you do have to fix the error before you can move on.

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Fri Jan 01, 2016 9:41 am

Mmm we are typing back and forth a lot. and page 2 looks like its going to be page 3 soon. do you not think just giving an abc step by step idiot proof instruction set might be easier. I dont envy any other newbie who picks up this thread after me?

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Fri Jan 01, 2016 10:40 am

Finally made a tiny bit of progress.
1. Got the burp sound to play through headphone socket on raspberry pi,
By entering the above code for forcing sound through headphone socket
(So here is a piece of information missing from the foundations learning physical computing burping jellybaby instructions) got to say doesnt inspire confidence in there other projects.
Went on to the puthon part of the instructions and very carefully entered the programming instructions and got this error message.

==========RESTART===========
>>>
Traceback (most recent call last) :
File "/home/pi/jellybaby/burp.py", line 6, in module>
GPIO.setwarnings(FALSE)
NameError: name 'FALSE' is not defined
>>>

DirkS
Posts: 10086
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Screaming jellybaby programming

Fri Jan 01, 2016 10:45 am

It's 'False', not 'FALSE'.
Case (and indentation) is extremely important in Python...

User avatar
B.Goode
Posts: 9025
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Screaming jellybaby programming

Fri Jan 01, 2016 10:55 am

choice.locks wrote: 1. Got the burp sound to play through headphone socket on raspberry pi,
By entering the above code for forcing sound through headphone socket
(So here is a piece of information missing from the foundations learning physical computing burping jellybaby instructions) got to say doesnt inspire confidence in there other projects.
You don't seem to have included what 'the above code' was, but I would have thought that the instruction given at step 7 of the worksheet [ https://www.raspberrypi.org/learning/bu ... worksheet/ ] was intended to achieve that?

If you want to provide constructive feedback to the Raspberry Pi Foundation on this resource you can do so here: https://github.com/raspberrypilearning/ ... aby/issues

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Fri Jan 01, 2016 11:08 am

The code that i had to enter to force test signal through the headphone socket
Was
omxplayer -o local burp.wav

I have found another posting on the forum that someone else ranminto problems
They had the error message
Resistor on pin 3
It might be good for someone to link these posts sorry i dont know how to do that
At present the other posting has no replies

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Fri Jan 01, 2016 11:15 am

You seem to be linking me to a subscribed site called github with charges. Is this raspberry pi foundations official route for feed back?

DirkS
Posts: 10086
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Screaming jellybaby programming

Fri Jan 01, 2016 11:26 am

choice.locks wrote:You seem to be linking me to a subscribed site called github with charges. Is this raspberry pi foundations official route for feed back?
There's a free plan. See https://github.com/pricing

User avatar
rpdom
Posts: 15897
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Screaming jellybaby programming

Fri Jan 01, 2016 11:33 am

choice.locks wrote:You seem to be linking me to a subscribed site called github with charges. Is this raspberry pi foundations official route for feed back?
Yes. You can sign up for free. The paid accounts give you more features, but you don't need those to do the basic stuff like report issues or even offer updates.

Return to “Beginners”