Raspberry Pi 2B Mod - GPIO how

Hello

I am usind a raspberry Pi 2 Mod B with NetBeans 8.1, Oracle JDK ME 8.2. I created is the compilation of all connections and the example program GPIOSample and currently running on th RPi, but none of the pins work. After that, I took off all the extra stuff and only use code to set the output pin 7. Added code to define and redefine the value of pines. Who compiles also but I do not see any work spindle. From my point of view, it should be RPi GPIO 26 socket number. What am I wrong douing?

Best regards, harald

Code should go in GPIOSample

/*

* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.

*/

package com.oracle.jmee.samples.gpio;

import java.io.IOException;

Import javax.microedition.midlet.MIDlet;

Import jdk.dio.DeviceManager;

Import jdk.dio.gpio.GPIOPin;

/**

* GPIOSample illustrates the basic GPIO functionality. The example opens the

* following DIO devices:

*/

SerializableAttribute public class GPIOSample extends MIDlet {}

GPIO pins that matches an LED

Led private GPIOPin = null;

@Override

public void startApp() {}

System.out.println("***");

System.out.println ("* GPIO sample started!")           *");

System.out.println("***");

try {}

int ledPinId = 7;

System.out.println ("Pin GPIO opening with the id" + ledPinId + "for the LED");

LED = DeviceManager.open (ledPinId);

System.out.println ("Success opening GPIO pin code" + ledPinId + "for the LED");

} catch (IOException ex) {}

System.out.println ("could not open pin");

destroyApp (true);

}

boolean Val = true;

for (int i = 0; i < 20; i ++)

{

try {}

Thread.Sleep (500); I know. Should not be done. Only for the test

}

catch (InterruptedException ex)

{

System.out.println("!!! «) ""Interrupted exception");

}

try {}

Val =! led.getValue ();

led.setValue (val);

}

catch (IOException ex) {}

System.out.println ("catch IOException ex");

}

System.out.println ("* next change of State:" + i + "is" + val);

}

destroyApp (true);

}

@Override

{} public void destroyApp (boolean unconditional)

System.out.println("***");

System.out.println ("* sample destroyed GPIO *");

System.out.println("***");

notifyDestroyed();

}

}

You have the permission of the api?

I just got my LED project work this afternoon, I had trouble with the code. You can try this to see if your works. Sound like we have the same configuration.

A few quick notes. It seems that you must set the PIN every time by:

Config1 GPIOPinConfig = new GPIOPinConfig (0.22, GPIOPinConfig.DIR_OUTPUT_ONLY, DeviceConfig.UNASSIGNED, 0, false);

Then call the pin code

Pin 1 = DeviceManager.open (config1) GPIOPin;

and a quick fix test to disable the pin code then.

PIN1. SetValue (true);

Thread.Sleep (4000);

PIN1. Close();

Used II pin GPIO 22 which is actual pin 15 of the Governing Council.

If you need more made me know, would be happy to help you.

I can send you my entire script if you wish

Adam

Tags: Java

Similar Questions

  • my computer is running in safe mode. How to disable this option?

    I recently had loging problem on the net. My computer has been configured with safe mode. Now everything is ok I can't remove safe mode. How to make a it?

    Hello

    ·         What is the operating system installed on the computer?

    ·         Don't you see that safe mode mentioned on the screen?

    Method 1: Restart the computer and see if it boots into normal mode.

    Method 2: Check if start-up active in the System Configuration settings.

    (a) click Start, type msconfig.exe in the Start Search box and press ENTER to start the System Configuration utility.

    For Windows XP, click Start, click run , and then type msconfig.exe. Press enter.

    (b) on the Startup tab, make sure Start is not checked under Startup Options. If you make any changes, click apply, OK and restart. Check to see if that helps.

    Please elaborate on the question so that we can help you best.

  • On startup, I get the error message: you function in script mode. How to fix the error message

    I get a message whenever I play computer games, you are in mode script, how to you get rid of this

    original title: How to reboot my computer

    Hi KathyHernandez,

    Here is a link to some steps that should take care of this issue.

    http://support.Microsoft.com/kb/308260

    Hope this helps,

    Eddie B.

  • My default printer changed suddenly in offline mode. How can I move this back to the line?

    my default printer changed suddenly in offline mode. How can I move this back to the line?

    Original title: printer

    First try the simple solution.  Right click on the printer in devices and printers, then select 'see what's printing.  When the printer queue window opens, click on "Printer" and ensure that there is no check next to 'Use printer offline'.  If there is a control, click once to remove it.

  • My printers they are in offline mode. How to reconnect to them on our network home?

    original title: unable to print

    My printers they are in offline mode. How to reconnect to them on our network home?

    Hello

    What is the brand and model of the printer?

    Method 1:

    First of all I suggest you run the troubleshooter and check if that helps.

    For more information visit http://windows.microsoft.com/en-us/windows7/Open-the-Printer-troubleshooter

    Method 2:

    You can also try the troubleshooting steps in the link below.

    The new status of the printer is "offline" after you remove a print queue and then restart a Windows computer

    http://support.Microsoft.com/kb/2027593

    To do: Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    How to back up and restore the registry in Windows

    http://support.Microsoft.com/kb/322756

    Method 3:

    I suggest you to follow the steps and check.

    (a) open the start menu and click on the "devices and printers". This will open a window with a list of the printers currently installed on your computer.

    (b) double-click the icon of the printer that you want to change online. The status of the printer appears in the form "printer: Ready" or "printer: offline.".

    (c) click on "printer: offline" and the menu of the printer. Click on "Printer" in the menu bar and uncheck "Use printer offline." This action will change the printer from offline to online mode.

    See also: printer in Windows http://windows.microsoft.com/en-US/windows/help/printer-problems-in-windows problems

  • Windows XP mode - 7: how to get the Realtek Audio Drivers with GS Wavetable outside normal? Instead of RDP Audio driver!

    1. I upgraded my comp to Windows 7, Ultimate because I need to use many XP programs. What I've discovered, is the virtual XP Mode is not the same thing as XP regular and many programs do not run properly. Particularly theAudio out to lunch and MS GS Wavetable is not available in XP Mode.

    2 - I end up having to buy another XP-Professional and installed in the same notebook. I have to turn off the laptop restart and select the Windows 7 to XP operating system. All old programs work fine under XP.

    3 - I continued looking for a fix for the XP Audio Mode or virtual. Almost 2 years now, I can not find such a simple solution.

    4. today, I found something on the Microsoft RDP Audio driver. What is the reason? Anyone know?

    5. are there available MS drivers or resources?

    I'm not interested in the commercial programs or attempts to scan my computer. MS sold Windows 7 that can run XP so I think that Microsoft is responsible for fixing.

    Thanks in advance,

    VT

    Windows XP mode - 7: how to get the Realtek Audio Drivers with GS Wavetable outside normal? Instead of RDP Audio driver!

    Hello

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the Windows Virtual PC and XP Mode Forums.

    http://social.technet.Microsoft.com/forums/en-us/w7itprovirt/threads

  • I have version 4. I can't use develop mode. How can I fix?

    I have version 4. I can't use develop mode. How can I fix?

    Thanks for the reply. I solved the problem by uninstalling the CC version and install the latest update of version 4.

    Sent from my iPhone

  • Ive bought a subscription for one year for applications, after that download some apps ive noticed that they are in the 30 days test modes. How can I get my creative cloud acknowledged he paid?

    Ive bought a subscription for one year for applications, after that download some apps ive noticed that they are in the 30 days test modes. How can I get my creative cloud acknowledged he paid?

    Try to connect and then reconnect again.

  • flash player mode disable how vulnerable protected?

    Lastest 38 FF now allows me to easily turn off protected mode FP which seems to heal my FP quite common crashes. The question I have is how vulnerable will I be if protected mode is disabled? I use FF with FP disabled for quite a while now with little inconvenience because almost everyone is using HTML. I'd appreciate comments everyone. Thank you

    It is obviously not safer, but in the real world (as long as you keep flash, your operating system, Firefox and your anti-virus software updated) it will not have a significant impact on your security. just stay smart online and use your common sense, do not install or click on things that look too good to be true.

  • When I launch Firefox, back mode minimized; How can I change?

    In one of the recent updates of Firefox, I think I gave a choice of opening in minimized and stupidly selected as mode. Now, whenever I load Firefox, it is in compact mode, and I have to restore it to open it. Not a big deal, but annoying. How to cancel this setting? This happens only on my desktop. It always opens in visible mode on my laptop that runs windows 7.

    Open Firefox, resize the window, close it.
    Open it again, now maximize.
    Or do your settings via the ALT "', at the top of the page, select"view"and make your choice...

  • When I use CMD to start a firefox.exe-silent mode installation, how to change the default direction (J = J:-* is not a job)

    in cmd, I use - ms for the installation in silent mode, but I don't want to install in c/program files, what am I, I'm going to do?

    I use one. INI configuration file to specify the installation directory.

    https://wiki.Mozilla.org/installer:Command_Line_Arguments has more information on the process.

    1 create a text file called firefox.ini

    2. Add the following line, and then save the file

    InstallDirectoryPath = x: \whatever\directory\you\want

    3. the command to run a silent installation using the INI file, that you created would be.

    Firefox.exe /INI=c:\wherever\firefox.ini

    Let me know how you go.

  • After updating to SP3, I have to restart. When I do that my computer goes to a safe mode. How to exit safe mode? I have to do a system restore to fix.

    I'm going to an auto to install update. The installation is correct. But when I do a restart, he comes back in a safe mode. I don't know what to do.

    Any help is greatly appreciated.

    I'm sorry, I thought you were all the same team. One of the members of the staff of microsoft helped me. I had to disable the 'pilot' and I had to change a valur at 4. After that, it works perfectly.

    In response to your earlier questions on Norton and McAfee. Yes thery have been installed with the computer, but I removed the programs. Whenever I tried to download SP3, I got in trouble. But even if I did a system restore. Everything still works from before. Not sure how many times I did it. But I wanted to finally come to a duty case or get a new computer.

    Thank you very much for your help and support.

    Sincerely

    R Q POWERS

  • IM the administrator of my computer but can't seem to access my account have to use children account, because I have this blue screen, cant even log on to safe mode? How can I solve this problem?

    can't get into my accont blue screen, peuvent ' t do it on safe mode, so I have no administrative privledges, how can I solve this problem? Help

    Hello

    1. What is the exact error message you get with the blue screen?

    Follow these steps and check if the problem persists.

    Step 1:

    Remove all external devices such as printers, USB drives and check if the problem persists.

    Step 2:

    Check if you are able to start in "last known good configuration".

    How to start your computer by using last good known Windows XP Configuration
    http://support.Microsoft.com/kb/307852

  • (Redirected) Dell Inspiron 15-5568 in tablet mode using - how to pull up a Yahoo email message

    I just bought an Inspiron 15-5568.  I put it in tablet mode, and I'm trying to get back an email in my Yahoo Inbox using IE.  I double click on one of the messages of email in my Inbox to pull up.  Instead of pulling up the message, double-click zooms the screen IE.  Another double click the zoom back again. I tried a number of different operations to get back an e-mail message, but nothing works.  I can get a context menu to appear next to a message, but there is no option to read or view the message.  If I was using a mouse, I would double click on the message and it would come.

    I have reviewed the user's guide, but it is not a great help.

    Can someone tell me please how to pull up an email message in Yahoo or Google Mail with an Inspiron 15-5568 in tablet mode?  It seems like it should be very simple, but it isn't.

    Thanks in advance.

    Hi RexFarris,

    Please repost this in the laptop computer Forum help.

    http://en.community.Dell.com/support-forums/laptop/f/3518

  • I have windows 7 and the computer will not open in safe mode. How can I fix this?

    I tried to use the configurations of systems, but this does not solve my problem. I use the F8 key and F10 keys but it always opens in safe mode.

    I need your help

    Claudia Hanks

    Run the SFC/scannow command. This will check and repair if necessary all of the critical Windows system files.

    Click on start / all programs/accessories then
    Right-click on the command prompt option and select "Run as Administrator".
    (or "Safe Mode" open a command prompt)
    At the command prompt, enter: SFC/scannow

    Windows 7 - order SCANNOW SFC - System File Checker
    http://www.SevenForums.com/tutorials/1538-SFC-SCANNOW-Command-System-File-Checker.html

    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7
    http://support.Microsoft.com/kb/929833

    How to analyze the entries in log file generating the program Checker (SFC.exe) resources of Microsoft Windows in Windows Vista:
    http://support.Microsoft.com/kb/928228

    ======================================================

    Diagnostics for use in safe mode
    http://Windows.Microsoft.com/en-us/Windows-Vista/diagnostic-tools-to-use-in-safe-mode

    J W Stuart: http://www.pagestart.com

Maybe you are looking for