Zarkopafilis
Posts: 16
Joined: Sat Sep 21, 2013 11:00 am

Need some verification from more experienced people

Mon Jun 13, 2016 7:24 pm

Hello. I've bought a raspberry pi B (that is now being used as a media player with Kodi). I had done some electrical engineering stuff with the RPi and the arduino before but now I have to face a bigger problem and I want to know wether my assumptions are going to be true.

First of all, I already know how to code (a lot!). I had used Java 8 with GPIO the last time that I fiddled around with the Pi. I see that there are new versions with more GPIO pins (40?) out there now. I was wondering if Java still works for this kind of thing (including deploying seamlessly from netbeans over lan) or do I need to mess with python?

Secondly, I can plug a usb wifi card, setup the Pi as a wifi hotspot as well as run a server on it right?(An app on a phone is going to connect and configure some stuff on the Pi that way).

And now, the project I am goign to attempt to make: Simple idea: 10 arcade buttons: 1 lights up, you need to press it as fast as you can. If it's the correct one, another button lights up and you need to do the same thing over and over again, with buttons being activated at random or configurable patterns.

Can the pi handle having 10 buttons as an input attached to it, as well as switching the lights for these buttons as well (10 outputs I guess). This is the button I am going to use: http://www.ebay.com/itm/Red-LED-Light-L ... SwcBhWXlnY. I think I am also going to use some tip 120s in order to turn the buttons' lights on and off.

Thank you very much for your time and thanks in advance!

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: Need some verification from more experienced people

Tue Jun 14, 2016 3:03 pm

Zarkopafilis wrote:Hello. I've bought a raspberry pi B (that is now being used as a media player with Kodi). I had done some electrical engineering stuff with the RPi and the arduino before but now I have to face a bigger problem and I want to know wether my assumptions are going to be true.

First of all, I already know how to code (a lot!). I had used Java 8 with GPIO the last time that I fiddled around with the Pi. I see that there are new versions with more GPIO pins (40?) out there now. I was wondering if Java still works for this kind of thing (including deploying seamlessly from netbeans over lan) or do I need to mess with python?
You can still use Java on a new Pi and access the 40 GPIO pins. The new Pi's are compatible with the same software, just with greater speed and more features.
Secondly, I can plug a usb wifi card, setup the Pi as a wifi hotspot as well as run a server on it right?(An app on a phone is going to connect and configure some stuff on the Pi that way).
Yes, or get a Pi 3 which has built in wifi.
And now, the project I am goign to attempt to make: Simple idea: 10 arcade buttons: 1 lights up, you need to press it as fast as you can. If it's the correct one, another button lights up and you need to do the same thing over and over again, with buttons being activated at random or configurable patterns.
Sounds like a fun doable product
Can the pi handle having 10 buttons as an input attached to it, as well as switching the lights for these buttons as well (10 outputs I guess). This is the button I am going to use: http://www.ebay.com/itm/Red-LED-Light-L ... SwcBhWXlnY. I think I am also going to use some tip 120s in order to turn the buttons' lights on and off.

Thank you very much for your time and thanks in advance!
These buttons have 12v LED's, so you will need to use a relay / transistor to switch on a 12v power supply to the LED, as the Pi only provides 3.3v.
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

Zarkopafilis
Posts: 16
Joined: Sat Sep 21, 2013 11:00 am

Re: Need some verification from more experienced people

Tue Jun 14, 2016 8:39 pm

LetHopeItsSnowing wrote:
Zarkopafilis wrote:Hello. I've bought a raspberry pi B (that is now being used as a media player with Kodi). I had done some electrical engineering stuff with the RPi and the arduino before but now I have to face a bigger problem and I want to know wether my assumptions are going to be true.

First of all, I already know how to code (a lot!). I had used Java 8 with GPIO the last time that I fiddled around with the Pi. I see that there are new versions with more GPIO pins (40?) out there now. I was wondering if Java still works for this kind of thing (including deploying seamlessly from netbeans over lan) or do I need to mess with python?
You can still use Java on a new Pi and access the 40 GPIO pins. The new Pi's are compatible with the same software, just with greater speed and more features.
Secondly, I can plug a usb wifi card, setup the Pi as a wifi hotspot as well as run a server on it right?(An app on a phone is going to connect and configure some stuff on the Pi that way).
Yes, or get a Pi 3 which has built in wifi.
And now, the project I am goign to attempt to make: Simple idea: 10 arcade buttons: 1 lights up, you need to press it as fast as you can. If it's the correct one, another button lights up and you need to do the same thing over and over again, with buttons being activated at random or configurable patterns.
Sounds like a fun doable product
Can the pi handle having 10 buttons as an input attached to it, as well as switching the lights for these buttons as well (10 outputs I guess). This is the button I am going to use: http://www.ebay.com/itm/Red-LED-Light-L ... SwcBhWXlnY. I think I am also going to use some tip 120s in order to turn the buttons' lights on and off.

Thank you very much for your time and thanks in advance!
These buttons have 12v LED's, so you will need to use a relay / transistor to switch on a 12v power supply to the LED, as the Pi only provides 3.3v.

Hey, first of all thanks for your reply :D. Having the ability to use inbuilt wifi is great! That said, I'm definately getting a RPi 3 model B I guess

Some last thing that is still unclear to me is wether I am going to be able to do all of these things with the 40 GPIO pins?
If I recall correctly that means that I have to use 10 GPIO pins as input for the buttons (with the buttons' other end plugged into the 3.3v rail) and use another 10 GPIO pins as output to some electrical switch in order to power on and off the button lights.
What makes me worried is the possibility of the board overloading/not being able to push out that much power/getting wasted.

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: Need some verification from more experienced people

Wed Jun 15, 2016 8:46 am

You wont have a problem.

Connect your buttons using a pull up to ground, so that when they are switched you connect ground to the GPIO.

Use the GPIOs to switch a relay (or probably just a transistor) which connect a separate 12v power supply to the LEDs.
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

User avatar
davidcoton
Posts: 4124
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Need some verification from more experienced people

Wed Jun 15, 2016 8:54 am

There is one possible issue -- I don't think there are 20 bare GPIO pins available in the default configuration. You may need to do some work in your code to select alternative modes for some of the pre-defined I/O pins, so they become General Purpose.
Signature retired

Zarkopafilis
Posts: 16
Joined: Sat Sep 21, 2013 11:00 am

Re: Need some verification from more experienced people

Wed Jun 15, 2016 8:35 pm

Alright thank you all! I am doing a small-scale experiment on my Model B to check out wether stuff are supposed to be the way I have imagined em and then if everything goes accordint to plan I'll procceed to the newer model.

Return to “Advanced users”