I am using Mplab x Ide with v3.61 on Xc8 compiler, PIC18F24K40. I used MCC generated UART code for send and receive data. For understanding I am clubling my code and posting part of it. My main code look like this #include "mcc_generated_files/mcc.h" #define EUSART_TX_BUFFER_SIZE 8 #define EUSART_RX_BUFFER_SIZE 8 /** Section: Global Variables */ volatile uint8_t eusartTxHead = 0; volatile uint8_t eusartTxTail = 0; volatile uint8_t eusartTxBuffer[EUSART_TX_BUFFER_SIZE]; volatile uint8_t eusartTxBufferRemaining; volatile uint8_t eusartRxHead = 0; volatile uint8_t eusartRxTail = 0; volatile uint8_t eusartRxBuffer[EUSART_RX_BUFFER_SIZE]; volatile uint8_t eusartRxCount; #define LED_RX RC7 // Pin assigned RX LED #define LED_TX RC6 // Pin assigned …

Member Avatar
Member Avatar
+0 forum 2

Hi, I have a simple usb device that i can plug into a PC. The thing im looking for in user interface that is: 1) Multiplatform 2) Manages it own drivers (for plug in USB device) 3) No install file, a executable. The thing im looking for is like this demonstation project: http://www.walking-productions.com/jsserial/new/JSSerial.html But project above (web applet) ... needs 1. jdk 2. jdk addtional files .ddl s (RXTX java usb include) My question is... Is there a way to do a web (browser) user interface for a plug in USB device. How to manage installation of plug in USB …

Member Avatar
Member Avatar
+0 forum 3

My web hosting service provider allows me to uplaod my ROOT.war file only. and there is no directory structure. So is there any way by which I can upload pics and add new pages or make changes in existing pages without re-uploading the entire ROOT.war file. P.S. I also want to learn how can I rename a file?. For example I want a user to upload his profile picture, now that picture should be saved in the images/user/profile_pic/user_no folder with the name user_no.gif. How can I achieve this?

Member Avatar
Member Avatar
+0 forum 1

Hello again! So now i can save the picture in the database, now i have to retrieve it. this is my code for the saving of the picture, [CODE]Dim ms As New MemoryStream() studentpic.Image.Save(ms, studentpic.Image.RawFormat) Dim arrImage() As Byte = ms.GetBuffer ms.Close() Dim strFilename As String = lblfilePath.Text.Substring(lblfilePath.Text.LastIndexOf("\")) Dim cnn As New SqlConnection(connectionString:="data source=.\sqlexpress; integrated security=true; attachdbfilename=|datadirectory|\WAIS.mdf; user instance=true;") Dim strSQL As String = "INSERT INTO ImagesStore (OriginalPath, ImageData)" & "VALUES (@OriginalPath, @ImageData)" Dim cmd As New SqlCommand(strSQL, cnn) With cmd .Parameters.Add(New SqlParameter("@OriginalPath", SqlDbType.NVarChar, 50)).Value = strFilename .Parameters.Add(New SqlParameter("@ImageData", SqlDbType.Image)).Value = arrImage End With cnn.Open() cmd.ExecuteNonQuery() cnn.Close()[/CODE] i saw on …

Member Avatar
Member Avatar
+0 forum 10

I need a problem, i use PIC simulator to import2 numbers by serial port. First I send byte, 5 for example, then send sent 2 and in the third step I sent char for example *, and the result is 5*2=10. Everything is fine till I send larger number more than 255. It says wrong entry, I know that I can send only 255 by byte. But how can I import larger number. What should be changed in the code to work for larger numbers. Some ideas??????? thanks a lot /================= konfigure LCD display // port for data PORTB sbit …

Member Avatar
Member Avatar
+0 forum 5

//================= konfigure LCD // porta za podatoci e PORTB sbit LCD_RS at RB4_bit; sbit LCD_EN at RB5_bit; sbit LCD_D4 at RB0_bit; sbit LCD_D5 at RB1_bit; sbit LCD_D6 at RB2_bit; sbit LCD_D7 at RB3_bit; sbit LCD_RS_Direction at TRISB4_bit; sbit LCD_EN_Direction at TRISB5_bit; sbit LCD_D4_Direction at TRISB0_bit; sbit LCD_D5_Direction at TRISB1_bit; sbit LCD_D6_Direction at TRISB2_bit; sbit LCD_D7_Direction at TRISB3_bit; char name; char txt[16]; void init(){ PORTB = 0xFF; TRISB = 0x00; ANSEL = 0x00; ANSELH = 0x00; C1ON_bit = 0; C2ON_bit = 0; UART1_Init(9600); Delay_ms(100); Lcd_Init(); Lcd_Cmd(_LCD_CLEAR); Lcd_Cmd(_LCD_CURSOR_OFF); } //========================================================= void main() { init(); UART1_Write_Text("Start"); UART1_Write(10); UART1_Write(13); do{ } while(!UART1_Data_Ready()); name = …

Member Avatar
+0 forum 0

hi, i doing a project to send MMS using PIC16F876.. how to define the pic16f876 in c++? thank in advance.

Member Avatar
Member Avatar
+0 forum 2

Hi all, I use the code below, and it's my idea it will give me on my LCDisplay the letters "Camil" (and yes, that is my name) All the first subroutines i just copied form [url]http://home.iae.nl/users/pouweha/lcd/lcd2.shtml[/url] - it has to work. From label start i did make anything myself. I'm sure i did connect the LCD and the PIC right, and i am sure the contrast is OK. I just think i don't understand how to use the subroutines. What happens is the following: the backlight does work, but there isn't any character. What's the problem - how do I …

Member Avatar
Member Avatar
+0 forum 1

I have this code working, I would like to change the fuction message to display a pic by its url insteed of the message popup. --------------- else if(k >= 6) { alert("It's tough ") --------------------- I am thinking along the lines of an else if (k >= 6{ echo <img = herf// do i need to change "function message() { " to something else ? do i need to add a picture box 1 = {} and then if k>= then picture box 1 = {} ? [CODE]<html> <head> <link rel="stylesheet" href="format.css"> <title>anyone</title> </head> <body> N E ONE </body> </html> …

Member Avatar
+0 forum 0

i am trying to create a videogame but im having trouble moving a picture. what im trying to do is move a picture called mario left, right, down, up... im trying to use the arrow keys... i dont have much experience either. everytime i press the up key the picture goes randomly to a certain spot. Everytime i press it it goes to the same spot >.> help me~[code]Private Sub picmario_KeyDown(KeyCode As Integer, Shift As Integer) Select Case KeyCode Case vbKeyRight 'this will move mario right picmario.Move picmario.Left - -50 Case vbKeyLeft 'this will move mario left picmario.Move picmario.Left - …

Member Avatar
Member Avatar
+0 forum 4

Hi all, Currently trying to write a piece of code for a project at university, with very little C Compiler experience I am struggling... Basically- we have 8 LED's, and 8 switches. We want 4 of the 8 LED's to light up at random when the program is run, that then have to be switched off in order using the corresponding switches. They must only be able to be done in order! E.g If LED's 0,2,4,7 light up, switch 0 must be turned off in order for LED 0 to go off, and LED 2 can only be switched off …

Member Avatar
Member Avatar
+0 forum 5

I used [URL="http://www.parallax.com/Store/Education/KitsandBoards/tabid/182/CategoryID/67/List/0/SortField/0/Level/a/ProductID/313/Default.aspx"]Parallax's Basic Stamp Homework Board[/URL] and an [URL="http://www.radioshack.com/product/index.jsp?productId=2909788"]accelerometer[/URL] to use as a mouse. It works better than I thought it would. [URL="http://sourceforge.net/projects/pyserial/"]PySerial[/URL] is used to grab the debugged values from the stamp. The circuit is compiled of two push buttons, 2 LEDs to tell when a button is pushed, and the accelerometer. The chip is coded in BASIC: Where IN9, IN10 are the push buttons and X on pin 8, Y on pin 7, and are read by pulse rate. [CODE] ' {$STAMP BS2} ' {$PBASIC 2.5} x VAR Word y VAR Word DO PULSIN 8, 1, x …

Member Avatar
+0 forum 0

The End.